1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-19 17:44:47 +02:00

Compare commits

..

117 Commits

Author SHA1 Message Date
Sebastien Helleu 72d15555ac Version 0.2.0 2006-08-19 11:58:58 +00:00
Sebastien Helleu 904ed30e82 Added missing API plugin functions in doc: mkdir_home, get_irc_color, input_color, get_window_info, free_window_info, get_buffer_info, free_buffer_info, get_buffer_data, free_buffer_data. Removed /panel command for release. 2006-08-19 11:09:38 +00:00
Sebastien Helleu f782970158 Removed /panel command for release (command under development) 2006-08-19 00:49:22 +00:00
Sebastien Helleu ffd9a850c2 Fixed typos 2006-08-19 00:46:13 +00:00
Sebastien Helleu 3e53c517d0 Updated russian translations 2006-08-18 22:39:43 +00:00
Julien Louis 9d59722879 Sync debian packaging 2006-08-17 23:57:44 +00:00
Sebastien Helleu 6db6b35e40 Added 'C'lear option on IRC raw buffer 2006-08-17 23:24:40 +00:00
Sebastien Helleu aacbf82675 IRC raw buffer now uses join/part prefix with color to display messages 2006-08-17 23:13:32 +00:00
Sebastien Helleu e64138b70a Fixed bug with display of message 329 (channel creation date), now displayed after a /cycle 2006-08-17 23:08:41 +00:00
Sebastien Helleu 440214d098 Added send of "quit" message to server when using /disconnect 2006-08-17 16:12:52 +00:00
Sebastien Helleu 17fdaf83d3 Fixed bug with display of message 329 (channel creation date), now displayed only when joining a new channel 2006-08-17 13:59:27 +00:00
Sebastien Helleu 487d776b87 Added IRC command 329 (channel creation date) 2006-08-17 13:23:31 +00:00
Sebastien Helleu 9f88f68e3b Added missing IRC commands: 310, 326 2006-08-17 12:00:49 +00:00
Sebastien Helleu 5a0461ac69 Fixed "wallops" command when received, now displayed by WeeChat (bug #17441) 2006-08-17 09:47:44 +00:00
Sebastien Helleu 48deeb9e77 Updated hungarian translations 2006-08-16 20:18:40 +00:00
Sebastien Helleu f6fb874c88 Fixed /wallops command (now many words are correctly sent) 2006-08-10 14:14:19 +00:00
Sebastien Helleu 8c2876a77c Fixed command 348 (channel exception list, received by /mode #chan e) 2006-08-10 13:58:10 +00:00
Sebastien Helleu 3060525426 Fixed crash when purging DCC when a closed DCC chat has no more buffer 2006-08-09 22:07:34 +00:00
Sebastien Helleu 5a4515b759 Added DCC fast in doc 2006-08-09 22:06:53 +00:00
Sebastien Helleu 8babdca0dc Added release note about /upgrade and modes when upgrading to version 0.2.0 2006-08-09 11:21:34 +00:00
Sebastien Helleu 1d211a16da Added missing modes (channel & user), now all modes are allowed (bug #16606), added "%m" for completion with self nick (on current server) 2006-08-07 22:26:55 +00:00
Sebastien Helleu f8c913a77a Added missing translations 2006-08-05 22:00:26 +00:00
Sebastien Helleu 5c56f9ff33 Added missing translations 2006-08-05 20:20:13 +00:00
Sebastien Helleu 8361053576 Fixed typo 2006-08-05 20:10:10 +00:00
Sebastien Helleu 70d6af7a0e Added missing IRC command 338 2006-08-05 20:05:53 +00:00
Sebastien Helleu fb607cb4ab Fixed DCC restore after /upgrade (now order is saved) 2006-08-05 19:33:48 +00:00
Sebastien Helleu b2183ee3ed Fixed away after server disconnection (now away is set again when reconnecting) (bug #16359) 2006-08-05 18:44:55 +00:00
Emmanuel Bouthenot 22b80dec65 adding functions : get_buffer_info, get_window_info, get_buffer_data and print_server in scripts API 2006-08-05 14:23:38 +00:00
Sebastien Helleu 8ee907af02 Fixed DCC file connection problem (connection from receiver to sender) 2006-08-05 11:20:58 +00:00
Sebastien Helleu a5cd14add5 Improved DCC speed (up to x5 on LAN) by forking for DCC files and a new option "dcc_fast_send" (does not wait for ACK) (task #5758) 2006-08-03 19:50:52 +00:00
Sebastien Helleu 34ee7e4076 Fixed compilation problems under Irix 2006-07-30 23:25:12 +00:00
Sebastien Helleu b11f2b2c4b Fixed crash when purging DCC with high number of DCC (> window size) 2006-07-30 20:41:49 +00:00
Sebastien Helleu aff43aa355 Added question about $TERM value 2006-07-29 20:10:51 +00:00
Sebastien Helleu d861cb0fd3 Use of constants for min/max DCC blocksize 2006-07-27 21:05:15 +00:00
Sebastien Helleu c92ad8b195 Updated options/commands for doc 2006-07-27 16:11:42 +00:00
Sebastien Helleu 06cc936937 Fixed completion for command handlers (now empty completion_template means nick completion, "-" string means no completion at all) 2006-07-27 16:04:46 +00:00
Sebastien Helleu 451f623c98 Fixed nick alignment problem when look_nickmode is off 2006-07-27 11:11:22 +00:00
Sebastien Helleu 8df7ac464b Added generic function for incoming numeric IRC commands (bug #16611) 2006-07-25 18:06:39 +00:00
Sebastien Helleu 2f6a4140d6 Fixed crash when doing "/part something" on a server buffer (bug #17201) 2006-07-25 15:26:41 +00:00
Sebastien Helleu 9909adc0a4 Removed useless call to doupdate() 2006-07-23 21:30:37 +00:00
Sebastien Helleu 3eced7694b Splited weechat.c into weechat.c and util.c 2006-07-23 11:19:09 +00:00
Sebastien Helleu b7fc6747f6 Charsets are now checked when set by /charset command 2006-07-22 19:46:09 +00:00
Sebastien Helleu ff82fdffb7 Updated translations 2006-07-19 20:46:09 +00:00
Sebastien Helleu 480e40d6f8 Fixed typo 2006-07-19 13:27:48 +00:00
Sebastien Helleu 5699898d5b Added "look_save_on_exit" option (patch from Emanuele Giaquinta) 2006-07-18 16:55:19 +00:00
Sebastien Helleu a0e5c4567b Fixed crash on DCC buffer under Darwin 8 (bug #17115) 2006-07-16 16:44:58 +00:00
Sebastien Helleu 4c4f5ab012 added some panel functions, fixed refresh bugs when terminal is resized: too many refreshs, display bug with splited windows 2006-07-16 11:04:10 +00:00
Sebastien Helleu c308b2ec1f Fixed typo 2006-07-15 17:29:29 +00:00
Sebastien Helleu cc47e94422 Replaced weechat-html(-one).xsl by .xsl.in in EXTRA_DIST 2006-07-10 13:29:42 +00:00
Sebastien Helleu 70331a15b5 Added "-delete" argument for /topic completion 2006-07-09 21:35:13 +00:00
Sebastien Helleu 6cf207f23a Renamed weechat-html-one.xsl to weechat-html-one.xsl.in 2006-07-07 10:31:50 +00:00
Sebastien Helleu 7fae7c504a Renamed weechat-html.xsl to weechat-html.xsl.in 2006-07-07 10:31:31 +00:00
Sebastien Helleu 7f68da2c74 Added configure option for doc XSL prefix (bug #16991) 2006-07-07 10:29:01 +00:00
Sebastien Helleu ee68e1c944 Fixed typo in help for script plugin commands (/perl, /python, /ruby, /lua) 2006-07-04 07:45:39 +00:00
Sebastien Helleu ede2bf1374 Fixed typos 2006-07-01 11:59:06 +00:00
Sebastien Helleu 9563cf2b9d Fixed bug with spaces in script names (bug #16957) 2006-06-30 13:02:25 +00:00
Sebastien Helleu 2068aa5322 Replaced call to plugin_find_server_channel() by gui_buffer_search() in weechat_plugin_get_buffer_data() 2006-06-29 13:37:44 +00:00
Julien Louis 0221e4ab15 Sync with official debian package 2006-06-29 09:55:23 +00:00
Sebastien Helleu f50ed1f267 Updated translations 2006-06-28 21:51:21 +00:00
Julien Louis f46984357d Fix evaluation of ${datadir} with new (CVS) autoconf 2006-06-28 21:50:28 +00:00
Sebastien Helleu b38908ff67 Fixed random crash when "MODE #chan -l" is received 2006-06-28 21:19:02 +00:00
Sebastien Helleu eccf1ad92d File automatically updated 2006-06-28 21:18:34 +00:00
Sebastien Helleu f0541c5f12 Fixed bug in IRC parser (random crash with malformed IRC messages) 2006-06-28 17:53:01 +00:00
Sebastien Helleu 37edc90d7f Fixed refresh bug (too many refresh) when terminal is resized 2006-06-26 21:21:43 +00:00
Sebastien Helleu 055a2c6a64 Fixed crash with crash dump (nice isn't it?) 2006-06-26 18:42:16 +00:00
Sebastien Helleu c5f1a1af6c Case ignored for channel names in charset options (bug #16858) 2006-06-26 09:58:55 +00:00
Sebastien Helleu e5ba6dcb85 Fixed crash when setting look_one_server_buffer to ON (bug #16932) 2006-06-24 08:41:01 +00:00
Sebastien Helleu 636a6ca088 Added new functions in plugin/script API: get window info, get buffer info, get buffer content 2006-06-22 16:23:47 +00:00
Emmanuel Bouthenot 9680e67a9a do not check words made of punctuation and digits and fix a bug while saving aspell plugin configuration 2006-06-20 18:00:47 +00:00
Sebastien Helleu 2a22ebbf06 Added Makefile.am for czech quickstart guide 2006-06-20 13:36:29 +00:00
Sebastien Helleu f4f63412f8 Added czech quickstart guide 2006-06-20 08:28:21 +00:00
Sebastien Helleu cd47f4246e Fixed FIFO samples in scripts 2006-06-17 07:03:12 +00:00
Emmanuel Bouthenot 7e3db3dfa4 improve aspell checking, do not check nicks in chans, take care of punctuation in words 2006-06-16 16:06:25 +00:00
Sebastien Helleu dc7595c78e Fixed display bug with special char (bug #16732) 2006-06-16 13:20:11 +00:00
Emmanuel Bouthenot daa802a6a2 improvements in python scripts context management 2006-06-16 11:39:00 +00:00
Emmanuel Bouthenot 3e17a27c01 improve python sub-interpreters management 2006-06-15 22:24:12 +00:00
Sebastien Helleu 87d3725823 Added color encoding for some commands like /me 2006-06-15 13:06:36 +00:00
Emmanuel Bouthenot a38b9ecf79 add iconv/libiconv detection 2006-06-15 09:04:12 +00:00
Sebastien Helleu d8b775d2c4 Renamed plugins names (removed "lib" prefix in name) 2006-06-14 16:23:53 +00:00
Sebastien Helleu f6ff17ebb0 Added completion info for buffers in crash/debug dump 2006-06-14 15:43:33 +00:00
Emmanuel Bouthenot 98338e2e20 clean code, rename global vars and function to avoid possibles crashs 2006-06-13 21:05:41 +00:00
Emmanuel Bouthenot de3d072220 improve global vars uses in plugins 2006-06-13 19:48:32 +00:00
Emmanuel Bouthenot 130d9012f8 add some improvements 2006-06-11 12:48:05 +00:00
Emmanuel Bouthenot c7cab37e16 add missing source header weechat-aspell.h 2006-06-11 12:19:39 +00:00
Emmanuel Bouthenot 99e3f219af make aspell plugin compile with gcc-2.95 2006-06-11 11:20:18 +00:00
Emmanuel Bouthenot 935d8e9304 adding aspell plugin 2006-06-11 02:28:23 +00:00
Emmanuel Bouthenot b48fb5c0ec add get_irc_color function in plugins/scripts 2006-06-10 21:34:16 +00:00
Sebastien Helleu 08aa5570d8 Added error message when home is not a directory (bug #16772) 2006-06-10 19:29:23 +00:00
Sebastien Helleu 62059cb614 Added plugin API function to get IRC color number by name 2006-06-10 18:59:43 +00:00
Sebastien Helleu 4e434e4fb3 Added IRC colors list in plugin header, fixed get_info for channel info (now ok with pv/dcc chat) 2006-06-10 18:07:57 +00:00
Sebastien Helleu 3b2e2ad006 Fixed crash when closing DCC/raw buffer if 2 are open (bug #16808) 2006-06-10 17:35:11 +00:00
Sebastien Helleu cb329a3f33 Fixed crashes with DCC chat remove/purge on DCC view (bug #16775) 2006-06-10 16:42:22 +00:00
Sebastien Helleu 59795445c5 Fixed typos 2006-06-09 22:22:02 +00:00
Sebastien Helleu c1e68a4d24 Modified makefiles for Polish quickstart guide 2006-06-09 05:35:08 +00:00
Julien Louis 9f9c2c7147 Add quickstart Polish translation 2006-06-08 22:13:22 +00:00
Sebastien Helleu 507ae028c5 Fixed problem with bnc (now connected to server when receiving 001, not 004) (bug #16760) 2006-06-07 16:24:17 +00:00
Sebastien Helleu 5235fd119c Added Makefile.am for russian quickstart guide 2006-06-05 22:24:57 +00:00
Sebastien Helleu 0fbcc93e6c Renamed quickstart_guide_ru.txt to weechat_quickstart.ru.txt 2006-06-05 22:06:26 +00:00
Sebastien Helleu 78b4477644 Renamed quickstart_guide_ru.txt to weechat_quickstart.ru.txt 2006-06-05 21:23:38 +00:00
Emmanuel Bouthenot e5eedac4c3 fix a crash in plugin function get_config with config string values stored as int 2006-06-04 12:57:02 +00:00
Julien Louis 439cc20c3d Add russian translation of quickstart_guide 2006-06-03 21:31:06 +00:00
Sebastien Helleu 6460e337f2 Fixed typo 2006-06-01 17:48:56 +00:00
Sebastien Helleu 4af2f3a02d Revert back for plugin loaded, use of GLOBAL instead of LOCAL (problems with Perl DynaLoader) 2006-06-01 14:16:23 +00:00
Sebastien Helleu 7509710c33 Added quickstart guide to .spec for RPM build 2006-06-01 09:09:58 +00:00
Sebastien Helleu 39cc46b609 Added german quickstart guide 2006-05-31 22:10:13 +00:00
Sebastien Helleu 0c7f9f274d Fixed make clean in doc which was deleting weechat quickstart guide 2006-05-31 20:54:17 +00:00
Sebastien Helleu 16c7e4b61c Fixed plugins symbol problem (removed global flag when loading library) 2006-05-31 20:44:04 +00:00
Sebastien Helleu 1ac38c3458 Added quickstart guide 2006-05-31 09:37:11 +00:00
Sebastien Helleu ad624059ad Command /save now writes plugins options (~/.weechat/plugins.rc) 2006-05-29 23:03:53 +00:00
Sebastien Helleu 6599c52352 Fixed /perl command output when no keyboard handler is defined 2006-05-29 22:42:07 +00:00
Sebastien Helleu fe90f3d4e4 Fixed crash with "register" function in plugin scripts (bug #16701) 2006-05-29 22:36:29 +00:00
Sebastien Helleu 8b0ca6ac41 Fixed typo 2006-05-28 18:18:08 +00:00
Sebastien Helleu 7f0a3f795b Fixed random crash at exit (/quit or /upgrade) with splited windows 2006-05-25 19:12:31 +00:00
Sebastien Helleu 02c0b9fab3 Fixed typo 2006-05-25 18:11:46 +00:00
Sebastien Helleu 37b5e25f7f Fixed typos in handler samples 2006-05-25 16:41:10 +00:00
Sebastien Helleu 2e7e88f7fa Replaced tail by sed 2006-05-25 16:39:41 +00:00
Sebastien Helleu 5816e4526e Version 0.2.0-cvs 2006-05-25 00:12:33 +00:00
234 changed files with 41534 additions and 23968 deletions
+878 -763
View File
File diff suppressed because it is too large Load Diff
+47 -1
View File
@@ -1,7 +1,53 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2006-05-25
ChangeLog - 2006-08-19
Version 0.2.0 (2006-08-19):
* added 'C'lear option on IRC raw buffer
* IRC raw buffer now uses join/part prefix with color to display messages
* added send of "quit" message to server when using /disconnect
* fixed "wallops" command when received, now displayed by WeeChat (bug #17441)
* fixed /wallops command (now many words are correctly sent)
* fixed command 348 (channel exception list, received by /mode #chan e)
* added missing modes (channel & user), now all modes are allowed (bug #16606)
* added "%m" for completion with self nick (on current server)
* added missing IRC commands (310, 326, 329, 338)
* fixed DCC restore after /upgrade (order is now correctly saved)
* fixed away after server disconnection (now away is set again when
reconnecting) (bug #16359)
* fixed DCC file connection problem (connection from receiver to sender)
* improved DCC speed (up to x5 on LAN) by forking for DCC files and a
new option "dcc_fast_send" (does not wait for ACK) (task #5758)
* fixed crash when purging DCC with high number of DCC (> window size)
* fixed completion for command handlers (now empty completion_template
means nick completion, "-" string means no completion at all)
* fixed nick alignment problem when look_nickmode is off
* added generic function for incoming numeric IRC commands (bug #16611)
* fixed crash when doing "/part something" on a server buffer (bug #17201)
* charsets are now checked when set by /charset command
* added "look_save_on_exit" option (patch from Emanuele Giaquinta)
* fixed crash on DCC buffer under Darwin 8 (bug #17115)
* added configure option for doc XSL prefix (bug #16991)
* fixed bug with spaces in script names (bug #16957)
* fixed random crash when "MODE #chan -l" is received
* fixed bug in IRC parser (random crash with malformed IRC messages)
* fixed refresh bugs when terminal is resized: too many refreshs,
display bug with splited windows
* case ignored for channel names in charset options (bug #16858)
* fixed crash when setting look_one_server_buffer to ON (bug #16932)
* added new functions in plugin/script API: get window info,
get buffer info, get buffer content
* added polish, russian and czech quickstart guide
* fixed display bug with special char (bug #16732)
* added color encoding for some commands like /me
* renamed plugins names (removed "lib" prefix in name)
* fixed crash when closing DCC/raw buffer if 2 are open (bug #16808)
* fixed crashes with DCC chat remove/purge on DCC view (bug #16775)
* fixed bug with connection to bnc (bug #16760)
* command /save now writes plugins options (~/.weechat/plugins.rc)
* fixed crash with "register" function in plugin scripts (bug #16701)
* fixed random crash at exit (/quit or /upgrade) with splited windows
Version 0.1.9 (2006-05-25):
* fixed /squery command (message sent to server, now ok with # args > 2)
+13 -2
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2006-05-25
WeeChat FAQ, 2006-08-19
=======================
Intended audience:
@@ -75,7 +75,7 @@ A: For help you can type /help. For help about a command, type /help command.
2.3
================================================================================
Q: I don't see come chars with accents, what can I do?
Q: I don't see some chars with accents, what can I do?
A: You have to setup charset used for decoding (ISO and UTF), encoding, and
internal WeeChat charset.
@@ -139,6 +139,17 @@ A: You can use /lua command to load scripts (default path is
when WeeChat is starting up.
Lua scripts are not compatible with other IRC clients.
2.9
================================================================================
Q: When I'm using weechat under screen, I have weird chars, when I switch
window for example, how to fix that?
A: This may be caused by bad value of TERM variable (look at echo $TERM).
For example, "xterm-color" displays such weird chars, use "xterm" which
is ok (like many other values).
3.1
================================================================================
Q: How should I report bugs?
+11 -1
View File
@@ -1,4 +1,4 @@
WeeChat FAQ, 2006-05-25
WeeChat FAQ, 2006-08-19
=======================
Public concerné :
@@ -145,6 +145,16 @@ R: La commande /lua permet de charger les scripts Lua (le chemin par
Les scripts Lua ne sont pas compatibles avec d'autres clients IRC.
2.9
================================================================================
Q: Quand j'utilise weechat sous screen, j'ai des caractères bizarres
notamment en changeant de fenêtre, comment corriger ça ?
R: Cela peut être du à la variable TERM qui n'a pas la bonne valeur
(regardez echo $TERM). Par exemple "xterm-color" provoque ce genre de
problèmes, utilisez "xterm" qui est ok (comme plein d'autres valeurs).
3.1
================================================================================
Q: Comment dois-je reporter les bugs ?
+11
View File
@@ -1,6 +1,17 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
* FlashCode, 2006-08-19
Important release notes:
- if you upgraded with /upgrade in WeeChat, you should /disconnect and
then /reconnect on each server, to display properly channel/user modes
- if you're using plugins, you should remove some old plugins libraries
in WeeChat system library directory (commonly
/usr/local/lib/weechat/plugins): remove lib* files (like libperl.*,
libpython.*, ..) and keep only new libraries (perl.*, python.*, ..)
* FlashCode, 2006-05-25
WeeChat 0.1.9 released.
+159 -34
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.9, flashcode@flashtux.org)
AC_INIT(WeeChat, 0.2.0, flashcode@flashtux.org)
AC_CONFIG_SRCDIR([src/common/weechat.c])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([weechat], [0.1.9])
AM_INIT_AUTOMAKE([weechat], [0.2.0])
# Checks for programs
AC_PROG_CC
@@ -96,26 +96,29 @@ 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([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
AH_VERBATIM([DEBUG], [#undef DEBUG])
# Arguments for ./configure
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(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, [ --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)
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(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, [ --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(aspell, [ --disable-aspell Turn off Aspell plugin (default=compiled if found)],enable_aspell=$enableval,enable_aspell=yes)
AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_WITH(doc_xsl_prefix, [ --with-doc-xsl-prefix=DIR Docbook html/chunk.xsl is in DIR (default=autodetect)],doc_xsl_prefix=$withval,doc_xsl_prefix='')
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
not_found=""
@@ -139,8 +142,8 @@ if test "x$enable_ncurses" = "xyes" ; then
fi
else
NCURSES_LIBS="-lncursesw"
AC_CHECK_HEADERS(ncursesw/curses.h)
fi
AC_CHECK_HEADERS([ncurses.h ncursesw/curses.h])
AC_SUBST(NCURSES_LIBS)
fi
@@ -185,6 +188,42 @@ if test "x$enable_gtk" = "xyes" ; then
fi
fi
# ------------------------------------------------------------------------------
# iconv
# ------------------------------------------------------------------------------
iconv_found="no"
AC_CHECK_HEADER(iconv.h,ac_found_iconv_header="yes",ac_found_iconv_header="no")
if test "x$ac_found_iconv_header" = "xyes" ; then
AC_CHECK_LIB(iconv,iconv_open,ac_found_iconv_lib="yes",ac_found_iconv_lib="no")
if test "x$ac_found_iconv_lib" = "xyes" ; then
LIBS="$LIBS -liconv"
fi
AC_MSG_CHECKING(for iconv usability in programs)
AC_TRY_RUN([
#include <iconv.h>
int main(int argc, char **argv) {
iconv_t conv = iconv_open("ISO8859-1", "UTF-8");
if (conv != (iconv_t) -1) {
return 0;
}
return 1;
}],iconv_found="yes")
if test "x$iconv_found" = "xno" ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
fi
if test "x$iconv_found" = "xno" ; then
AC_MSG_ERROR([
*** Iconv headers and/or libraries couldn't be found in your system.
*** Try to install them with your software package manager.
*** WeeChat can't be built without Iconv support.])
fi
# ------------------------------------------------------------------------------
# plugins
# ------------------------------------------------------------------------------
@@ -197,6 +236,7 @@ if test "x$enable_plugins" != "xyes" ; then
enable_python="no"
enable_ruby="no"
enable_lua="no"
enable_aspell="no"
fi
# ---------------------------------- perl --------------------------------------
@@ -456,6 +496,42 @@ if test "x$enable_lua" = "xyes" ; then
AC_DEFINE(PLUGIN_LUA)
fi
# ------------------------------------------------------------------------------
# aspell
# ------------------------------------------------------------------------------
if test "x$enable_aspell" = "xyes" ; then
ASPELL_CFLAGS=""
ASPELL_LFLAGS=""
AC_CHECK_HEADER(aspell.h,ac_found_aspell_header="yes",ac_found_aspell_header="no")
AC_CHECK_LIB(aspell,new_aspell_speller,ac_found_aspell_lib="yes",ac_found_aspell_lib="no")
AC_MSG_CHECKING(for aspell headers and librairies)
if test "x$ac_found_aspell_header" = "xno" -o "x$ac_found_aspell_lib" = "xno" ; then
AC_MSG_RESULT(no)
AC_MSG_WARN([
*** Aspell headers and/or libraries couldn't be found in your system.
*** Try to install them with your software package manager.
*** WeeChat will be built without Aspell support.])
enable_aspell="no"
not_found="$not_found aspell"
else
AC_MSG_RESULT(yes)
ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
fi
fi
if test "x$enable_aspell" = "xyes" ; then
AC_SUBST(ASPELL_CFLAGS)
AC_SUBST(ASPELL_LFLAGS)
AC_DEFINE(PLUGIN_ASPELL)
fi
# ------------------------------------------------------------------------------
# dynamic loader
# ------------------------------------------------------------------------------
if test "x$enable_plugins" = "xyes" ; then
AC_CHECK_FUNCS(dlopen, LIBDL_FOUND=yes, LIBDL_FOUND=no)
if test "$LIBDL_FOUND" != "yes"; then
@@ -474,6 +550,7 @@ if test "x$enable_plugins" = "xyes" ; then
enable_python="no"
enable_ruby="no"
enable_lua="no"
enable_aspell="no"
not_found="$not_found plugins"
fi
fi
@@ -536,6 +613,39 @@ if test "x$debug" != "x0" ; then
fi
fi
# ------------------------------------------------------------------------------
# documentation
# ------------------------------------------------------------------------------
AC_MSG_CHECKING(for html/chunk.xsl)
DOC_XSL_PREFIX=""
if test -n "$doc_xsl_prefix"; then
doc_xsl_prefix_path="$doc_xsl_prefix"
else
doc_xsl_prefix_path="/usr/share/xml/docbook/xsl-stylesheets-1.69"
doc_xsl_prefix_path="${doc_xsl_prefix_arr} /usr/share/xml/docbook/stylesheet/nwalsh"
fi
for p in $doc_xsl_prefix_path; do
if test -f ${p}/html/chunk.xsl; then
DOC_XSL_PREFIX="$p"
fi
done
if test "x$DOC_XSL_PREFIX" == "x"; then
AC_MSG_RESULT(no)
enable_doc="no"
AC_MSG_WARN([
*** Docbook XSL files not found
*** WeeChat will be built without documentation.
*** Try ./configure --with-doc-xsl-prefix=DIR if you have DIR/html/chunk.xsl file])
else
AC_MSG_RESULT($DOC_XSL_PREFIX)
AC_SUBST(DOC_XSL_PREFIX)
enable_doc="yes"
fi
# ------------------------------------------------------------------------------
# general vars
# ------------------------------------------------------------------------------
@@ -550,23 +660,33 @@ fi
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
WEECHAT_LIBDIR=`eval echo ${libdir}/weechat`
WEECHAT_LIBDIR=`eval eval echo ${libdir}/weechat`
AC_DEFINE_UNQUOTED(WEECHAT_LIBDIR, "$WEECHAT_LIBDIR")
WEECHAT_SHAREDIR=`eval echo ${datadir}/weechat`
WEECHAT_SHAREDIR=`eval eval echo ${datadir}/weechat`
AC_DEFINE_UNQUOTED(WEECHAT_SHAREDIR, "$WEECHAT_SHAREDIR")
weechat_libdir=${libdir}/weechat
AC_SUBST(weechat_libdir)
COMMON_CFLAGS="-Wall -W"
AC_MSG_CHECKING([whether we have GNU assembler])
GAS=`as --version < /dev/null 2>/dev/null | grep GNU`
if test "$GAS"; then
COMMON_CFLAGS="${COMMON_CFLAGS} -pipe"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
CFLAGS=`echo $CFLAGS | sed s/-g//g`
if test "x$CFLAGS" = "x" ; then
CFLAGS="-O2"
fi
if test "x$debug" = "x1" || test "x$debug" = "x2" ; then
CFLAGS="-Wall -W $CFLAGS -pipe -g"
CFLAGS="$COMMON_CFLAGS $CFLAGS -g"
else
CFLAGS="-Wall -W $CFLAGS -pipe"
CFLAGS="$COMMON_CFLAGS $CFLAGS"
fi
if test "x$debug" = "x2" ; then
@@ -592,8 +712,6 @@ netbsd*)
CFLAGS="$CFLAGS -pthread"
fi
CFLAGS="$CFLAGS $CPPFLAGS"
# bad hack
LDFLAGS="$LDFLAGS -liconv"
;;
gnu*)
if test "x$enable_plugins" = "xyes" ; then
@@ -608,23 +726,27 @@ 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")
AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes")
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(PLUGIN_ASPELL, test "$enable_aspell" = "yes")
AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes")
AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes")
AC_OUTPUT([Makefile
doc/Makefile
doc/en/Makefile
doc/fr/Makefile
doc/de/Makefile
doc/ru/Makefile
doc/pl/Makefile
doc/cs/Makefile
src/Makefile
src/common/Makefile
src/irc/Makefile
@@ -634,6 +756,7 @@ AC_OUTPUT([Makefile
src/plugins/scripts/python/Makefile
src/plugins/scripts/ruby/Makefile
src/plugins/scripts/lua/Makefile
src/plugins/aspell/Makefile
src/gui/Makefile
src/gui/curses/Makefile
src/gui/wxwidgets/Makefile
@@ -690,8 +813,10 @@ echo " Perl plugin......... : $enable_perl"
echo " Python plugin....... : $enable_python"
echo " Ruby plugin......... : $enable_ruby"
echo " Lua plugin.......... : $enable_lua"
echo " Aspell plugin....... : $enable_aspell"
echo "Compile with debug info........... : $msg_debug_compiler"
echo " Backtrace........... : $enable_backtrace"
echo "Build doc..........................: $enable_doc"
echo "Print debugging messages.......... : $msg_debug_verbose"
echo ""
eval echo "WeeChat will be installed in $bindir."
+26
View File
@@ -1,3 +1,29 @@
weechat (0.1.9-3) unstable; urgency=low
* Remove gnutls Build-Depends introduced in the previous upload
(closes: #379765).
* Move xsltproc, docbook-xml, docbook-xsl to Build-Depends-Indep.
* Change icon format from png to xpm.
-- Julien Louis <ptitlouis@sysif.net> Tue, 25 Jul 2006 11:53:25 +0200
weechat (0.1.9-2) unstable; urgency=low
* Fix ${datadir} expansion in configure.in which caused some problem when
loading scripts from /usr/share/weechat.
* Add weechat-scripts to weechat-plugins Suggests.
* Apply patch from Andreas Metzler to make weechat binNMUable
(Closes: #379419).
* Build-Depends against libgnutls13-dev | libgnutls-dev.
-- Julien Louis <ptitlouis@sysif.net> Sun, 23 Jul 2006 17:28:34 +0200
weechat (0.1.9-1) unstable; urgency=low
* New upstream release
-- Julien Louis <ptitlouis@sysif.net> Thu, 25 May 2006 07:40:53 +0200
weechat (0.1.8-2) unstable; urgency=low
* Switch to cdbs
+6 -4
View File
@@ -3,12 +3,13 @@ Section: net
Priority: optional
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
Uploaders: Julien Louis <ptitlouis@sysif.net>
Build-Depends: cdbs, debhelper (>= 5), libncursesw5-dev, ruby, ruby1.8-dev, libperl-dev, python-dev, liblualib50-dev, libgnutls-dev, libtool, xsltproc, docbook-xsl, docbook-xml
Build-Depends-Indep: xsltproc, docbook-xsl, docbook-xml
Build-Depends: cdbs, debhelper (>= 5), libncursesw5-dev, ruby, ruby1.8-dev, libperl-dev, python-dev, liblualib50-dev, libgnutls-dev, libtool, dpkg-dev (>= 1.13.19)
Standards-Version: 3.7.2
Package: weechat
Architecture: all
Depends: weechat-common (= ${Source-Version}), weechat-curses (= ${Source-Version})
Depends: weechat-common (= ${source:Version}), weechat-curses (>= ${binary:Version})
Description: Fast, light and extensible IRC client
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
for many operating systems. Everything can be done with a keyboard.
@@ -25,8 +26,8 @@ Description: Fast, light and extensible IRC client
Package: weechat-curses
Architecture: any
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
Recommends: weechat-plugins (= ${Source-Version})
Depends: ${shlibs:Depends}, weechat-common (= ${source:Version})
Recommends: weechat-plugins (= ${binary:Version})
Description: Fast, light and extensible IRC client
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
for many operating systems. Everything can be done with a keyboard.
@@ -52,6 +53,7 @@ Description: Common files for WeeChat
Package: weechat-plugins
Architecture: any
Depends: ${shlibs:Depends}
Suggests: weechat-scripts
Description: Plugins for WeeChat
This package provides some plugins to enhance weechat with scripting languages
such as perl python or ruby.
+1 -1
View File
@@ -31,4 +31,4 @@ include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk
install/weechat-common::
install -D -o root -g root -m 644 weechat_icon_32.png $(CURDIR)/debian/weechat-common/usr/share/pixmaps/weechat_icon_32.png
install -D -o root -g root -m 644 debian/weechat.xpm $(CURDIR)/debian/weechat-common/usr/share/pixmaps/weechat.xpm
+1
View File
@@ -0,0 +1 @@
doc/weechat-curses.1
+1 -1
View File
@@ -1,4 +1,4 @@
?package(weechat-curses):needs="text" section="Apps/Net" \
title="weechat-curses" \
icon="/usr/share/pixmaps/weechat_icon_32.png" \
icon="/usr/share/pixmaps/weechat.xpm" \
command="/usr/bin/weechat-curses"
+295
View File
@@ -0,0 +1,295 @@
/* XPM */
static char *weechat[] = {
/* columns rows colors chars-per-pixel */
"32 32 257 2",
" c #000000",
". c #0A0904",
"X c #080813",
"o c #080716",
"O c #110D08",
"+ c #150A15",
"@ c #1A0D1A",
"# c #19150C",
"$ c #151517",
"% c #1F1F32",
"& c #13132C",
"* c #260A26",
"= c #351935",
"- c #271927",
"; c #262608",
": c #322C0C",
"> c #36380B",
", c #353316",
"< c #232516",
"1 c #242224",
"2 c #292935",
"3 c #2D302D",
"4 c #2D3330",
"5 c #3B333B",
"6 c #1D1C4A",
"7 c #110F7B",
"8 c #0E0D65",
"9 c #221F60",
"0 c #282948",
"q c #292855",
"w c #333447",
"e c #383855",
"r c #2A2978",
"t c #302F70",
"y c #353465",
"u c #363574",
"i c #2A286E",
"p c #2E4110",
"a c #39410C",
"s c #3E4C11",
"d c #3F5220",
"f c #394041",
"g c #3E4753",
"h c #493F11",
"j c #4F1050",
"k c #4A0F4B",
"l c #572657",
"z c #4D374D",
"x c #403F6F",
"c c #640964",
"v c #641E64",
"b c #701770",
"n c #790A79",
"m c #683C68",
"M c #623662",
"N c #6B2B6B",
"B c #454A08",
"V c #484C15",
"C c #554B16",
"Z c #58560A",
"A c #595B0B",
"S c #545715",
"D c #4C5712",
"F c #4D5034",
"G c #504F24",
"H c #4E710E",
"J c #4D7C1C",
"K c #5B6713",
"L c #506B11",
"P c #546927",
"I c #506D2E",
"U c #665B14",
"Y c #696C0C",
"T c #68730D",
"R c #6F7010",
"E c #707128",
"W c #4D504D",
"Q c #46456A",
"! c #4C4C7B",
"~ c #434577",
"^ c #554C69",
"/ c #5B5A7D",
"( c #54547A",
") c #535964",
"_ c #567745",
"` c #4D6B57",
"' c #5D6C78",
"] c #587069",
"[ c #6A487C",
"{ c #6D576D",
"} c #645475",
"| c #76557A",
" . c #786678",
".. c #70707D",
"X. c #676768",
"o. c #3F3E82",
"O. c #2D2BAA",
"+. c #3D3BA4",
"@. c #3B39B9",
"#. c #484888",
"$. c #4A4C96",
"%. c #585885",
"&. c #595890",
"*. c #555494",
"=. c #4745A6",
"-. c #4947B5",
";. c #514FBB",
":. c #5A58BB",
">. c #5C5BAF",
",. c #755581",
"<. c #605FB6",
"1. c #6B6883",
"2. c #68679B",
"3. c #7A7497",
"4. c #76698F",
"5. c #6968A6",
"6. c #706FB5",
"7. c #7675BB",
"8. c #6E6DB6",
"9. c #4947C3",
"0. c #5351C2",
"q. c #5D5BC0",
"w. c #6B6ACC",
"e. c #6361C7",
"r. c #7170C6",
"t. c #7877D2",
"y. c #56840C",
"u. c #6A8814",
"i. c #63980B",
"p. c #748614",
"a. c #7F9C0D",
"s. c #749218",
"d. c #698F13",
"f. c #6C852A",
"g. c #798C35",
"h. c #76912B",
"j. c #76B505",
"k. c #70A50F",
"l. c #7EA525",
"z. c #678946",
"x. c #A57A5A",
"c. c #9A1E9A",
"v. c #861B86",
"b. c #912B92",
"n. c #8A298A",
"m. c #A030A0",
"M. c #864886",
"N. c #8F469E",
"B. c #975897",
"V. c #8A788A",
"C. c #936A93",
"Z. c #987599",
"A. c #866892",
"S. c #9470AB",
"D. c #A25FA2",
"F. c #B16FB1",
"G. c #B07FB1",
"H. c #B776B7",
"J. c #807FD0",
"K. c #A37AC2",
"L. c #87880B",
"P. c #888513",
"I. c #869A0A",
"U. c #8B9B14",
"Y. c #94970D",
"T. c #9B9C13",
"R. c #98961A",
"E. c #968D16",
"W. c #929D2F",
"Q. c #82A90B",
"!. c #8CAA06",
"~. c #82B30A",
"^. c #84B706",
"/. c #97A913",
"(. c #96B90A",
"). c #99B914",
"_. c #91AB10",
"`. c #A39A1C",
"'. c #A09A3D",
"]. c #A9AE05",
"[. c #A7AA16",
"{. c #A7B90B",
"}. c #ACB712",
"|. c #BDBA18",
" X c #B7B711",
".X c #B0B726",
"XX c #9A8B4B",
"oX c #9EC008",
"OX c #BCC40D",
"+X c #BCC90E",
"@X c #B1C707",
"#X c #AEC90C",
"$X c #C4AE2A",
"%X c #C4CB11",
"&X c #C8D809",
"*X c #CBD011",
"=X c #D1CF1A",
"-X c #D1D50E",
";X c #D7E803",
":X c #918197",
">X c #858494",
",X c #8987BA",
"<X c #928BBB",
"1X c #9B9BA8",
"2X c #9B98B8",
"3X c #8784A3",
"4X c #A787A8",
"5X c #AE9CAE",
"6X c #AC99B1",
"7X c #B988B9",
"8X c #BB92BC",
"9X c #B598B8",
"0X c #A0A0A7",
"qX c #A6A6B7",
"wX c #8382C6",
"eX c #8382D4",
"rX c #8D8CD4",
"tX c #9C8CC7",
"yX c #908FD9",
"uX c #9493C6",
"iX c #9A99DB",
"pX c #9493D3",
"aX c #A693C8",
"sX c #A09AD5",
"dX c #A8A5C9",
"fX c #A9A6D6",
"gX c #B7A8C7",
"hX c #B7B6DA",
"jX c #B5B1CE",
"kX c #B7B4E2",
"lX c #A9A8E2",
"zX c #C88EC8",
"xX c #C38BC3",
"cX c #C695C6",
"vX c #C2ADC2",
"bX c #C7A6C7",
"nX c #C4B5C4",
"mX c #C6B9D3",
"MX c #DDB9DD",
"NX c #D9B4D9",
"BX c #D3A4D4",
"VX c #C9C5CA",
"CX c #CAC9D7",
"ZX c #D4CBD4",
"AX c #D9C1D9",
"SX c #DACEDA",
"DX c #C4C3E4",
"FX c #CBC9E6",
"GX c #D8D7E6",
"HX c #E7CCE7",
"JX c #E9CFE9",
"KX c #EADBEA",
"LX c #E4DAE4",
"PX c #EDE2ED",
"IX c #EAEAF4",
"UX c #F0E1F0",
"YX c None",
/* pixels */
"YXYXYXYXYXYXYXYXYXSXLXIXUXCX YXYXYXYXVXLXPXPXZX. YXYXYXYXYX",
"YXYXYXYXYXYXYXnXKXUXUXKXJXSXnX YXnXKXPXPXPXKXSXnX YXYXYXYX",
"YXYXYXYXYXYX9XHXJXMX0XvX:X9XSX .HXJXAX5XvX>XvXAX. YXYXYXYX",
"YXYXYXYXYXYXMXMXkXx.. | 4XNXvX NXMXMXV. { 4XNXbX YXYXYX",
"YXYXYXYXYXBXBX8XZ. 4X8X8XZ. { BX8X4X G.7XcXZ. YXYXYX",
"YXYXYXYXLXcXcXC.z zXxX7X) X.G.G.C.z zXcX7X5 5 VX YXYX",
"YXYX1XIXGXBXCXC.+ H.H.F.6XIXIX8X| B.- F.H.8X5X0XCXCX YX",
"YXYX3 GXmX8XmXZ.M M.D.m | VXCXGX4X| B.M.B.D.m gXqX1XCXW YX",
"YXYX CXgXS.jXA.= + = 2XFXqXFXZ.| n.l @ = jX>X..GX$ YX",
"YXYX hXaXA.jX,.= + kXFXDXFX3.{ m l * w hXV.2XdX YX",
"YXYX hXdX,.fX[ v n.j b.kX2XDXhX1.4.v b.m.j S.tX3XkX1. YX",
"YXYX fXdX4.aX^ j v.c.N.fX) kXuX} <X= b c.c.G.tX1.kX% YXYX",
"YXYX <XfXuX<X[ k c c S.uX( fX,X' iXk c n b tX/ 3.uX YXYX",
"YXYX 2.iXrX2./ $ pX2.6.rX,XQ iX2 2 iXQ pX/ YXYX",
"YXYX e rXrX( %.e ( rX( 5.7.wXQ J.y 5.yX( yX& YXYXYX",
"YXYXYX t.eXQ 5.~ 7.7.2.% 2.eX&.2.&. J.6.8.5. YXYXYX",
"YXYXYX r.t.y 8.#.o 8.~ *. x t.r.~ 8. 0 t.! r.0 o $ F YXYXYX",
"YXYXYX <.w.~ >.#.d ] #.0 q w.w.y w.o #.e.$.<.. d I I YX",
"YXYXYX =.e.=.#.g z.I t X q ;.e.u :.y :.o.q.u < J y.d YX",
"YXYXYX y 0.0.r ] _ I 6 o -.0.-.=.0.;.t 0.o , I y.p YX",
"YXYXYXYX 9.9.i ' _ g X + +.9.9.@.;.i +.r y.k.i.y.H ",
"YXYXXXW.Q.] =.@.z.J 4 . V s.E o.@.@.-.' d.z.L ; s j.j.j.i.D ",
"YXXXW.Q.Q.f.) O.l.f.# D Q.u.u.o O.$.g.g.h.^.^.> s.oX~.~.u.s ",
"YX}.oXD a P w 9 ~.f.S T p.p.K ~ ).g q g j.(.. # k.a.K ",
".X#X{. . ; 7 0 _.!.V O I.U.C . oXg.6 8 4 Y.(. a /.).T ",
"+X#X(. 1 # T.{., #X{.C B +XI. I./.{. T #XoXA YX",
"&X+X}.Y P.%X[.P.+X@X. &X@XY Z ;X/.A T.OX}.+X; Y.}.[.B YXYX",
".X*XOX;X;X XZ T.*XL. =X%XP.; ;X%X*XT.> `.|., ].`. X: YXYX",
". Y.].T.A . C C ; $X-Xh P.].R O R : XE.P.O YXYX",
" E U C . YXYX",
"YX YX. # YXYXYX",
"YXYXYXYXYXYXYXYXYXYXYXYXYX YXYXYXYXYXYXYXYXYX YXYXYXYXYX"
};
+13 -2
View File
@@ -15,8 +15,19 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
SUBDIRS = en fr de
SUBDIRS = . en fr de ru pl cs
man_MANS = weechat-curses.1
EXTRA_DIST = $(man_MANS) weechat-doc.css weechat-html-one.xsl weechat-html.xsl
EXTRA_DIST = $(man_MANS) weechat-doc.css weechat-html-one.xsl.in weechat-html.xsl.in
all-local: weechat-html.xsl weechat-html-one.xsl
weechat-html.xsl: weechat-html.xsl.in
sed -e 's,\@DOC_XSL_PREFIX\@,$(DOC_XSL_PREFIX),g' < weechat-html.xsl.in > weechat-html.xsl
weechat-html-one.xsl: weechat-html-one.xsl.in
sed -e 's,\@DOC_XSL_PREFIX\@,$(DOC_XSL_PREFIX),g' < weechat-html-one.xsl.in > weechat-html-one.xsl
clean-local:
-rm -f weechat-html.xsl weechat-html-one.xsl
+4 -4
View File
@@ -49,13 +49,13 @@ $warning_do_not_edit = "\n<!-- ********* WARNING! *********\n\n"
foreach $lng (@all_lang)
{
create_commands ($lng, $all_encodings{$lng},
"weechat-curses -w | tail +3", "weechat_commands");
"weechat-curses -w | sed 1,2d", "weechat_commands");
create_commands ($lng, $all_encodings{$lng},
"weechat-curses -i | tail +3", "irc_commands");
"weechat-curses -i | sed 1,2d", "irc_commands");
create_key_func ($lng, $all_encodings{$lng},
"weechat-curses -f | tail +3", "key_functions");
"weechat-curses -f | sed 1,2d", "key_functions");
create_config ($lng, $all_encodings{$lng},
"weechat-curses -c | tail +3", "config");
"weechat-curses -c | sed 1,2d", "config");
print "\n";
}
+28
View File
@@ -0,0 +1,28 @@
# 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
#
LANGCODE = cs
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
# install docs
install-data-hook:
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
+104
View File
@@ -0,0 +1,104 @@
WeeChat (česká verze)
=========================
1. Spuštění weechat
Podle požadovaného GUI je třeba spustit:
- weechat-curses pro Curses GUI
- weechat-gtk pro GTK GUI (vyvíjí se)
- weechat-qt pro Qt GUI (není vyvíjeno)
- weechat-wxwidgets pro WxWidgets GUI (není vyvíjeno)
2. Online nápověda / možnosti
WeeChat má nápovědu pro všechny příkazy (/help příkaz)
Pro získání nápovědy k příkazu se používá /help příkaz
Pro nastavení voleb použijte /set volba = hodnota
Lze použít /set volba s částečným jménem (zobrazí všechny možnosti
obsahující písmena), nebo pouze s celým jménem volby bez hodnoty
(pro zobrazení dlouhé nápovědy k volbě).
Důležitá poznámka: nastavení je ukládáno při skončení WeeChat
(nebo pomocí příkazu /save). NEEDITUJTE kontiguracni soubor za
běhu WeeChat, protože do něj můŽe WeeChat kdykoliv zapsat
a není možné jej znovu načíst. Pro změnu jakýchkoliv voleb
použijte příkaz /set, WeeChat okamžitě použije nové nastavení.
3. Vytvoření serveru
Například irc.quakenet.org, port 6667:
/server quakenet irc.quakenet.org 6667
(pro kompletní nápovědu použijte /help server)
4. Nastavení vlastních voleb serveru
Přezdívky:
/set quakenet.server_nick1 = "mujeprezdivka"
/set quakenet.server_nick2 = "mujeprezdivka2"
/set quakenet.server_nick3 = "mujeprezdivka3"
Uživatelské jméno / skutečné jméno:
/set quakenet.server_username = "moje uživatelské jméno"
/set quakenet.server_realname = "moje skutečné jméno"
Automatické připojení k serveru:
/set quakenet.server_autoconnect = on
Ostatní volby:
Pro zobrazení voleb serveru a jejich hodnot použijte /set quakenet
Pro nastavení volby použijte /set quakenet.volba_serveru = hodnota
5. Připojení k serveru a automatické připojení ke kanálům
/connect quakenet
6. Příchod/odchod na/z kanálu
Příchod na kanál:
/join #kanál
Odchod z kanálu:
/part [ukončovací zpráva]
Odchod z kanálu a zavření bufferu:
/close [ukončovací zpráva]
(/close je alias na /buffer close)
7. Správa bufferů/oken
Buffery lze spravovat pomocí příkazu "/buffer" a okna pomocí
příkazu "/window".
Například pro rozdělení okna vertikálně na malé okno (1/3 šíčky)
a velké (2/3) použijte příkaz:
/window splitv 33
8. Klávesové zkratky
Podle Vaší klávesnice a/nebo potřeb si můžete změnit jakoukoliv
klávesu pomocí příkazu "/key".
Užitečná klávesa je meta-k (alt-k) pro nalezení klávesového kódu.
Například pro napojení meta-y (alt-y) na příkaz "/buffer close""
/key (stiskněte meta-k) (stiskněte meta-y) /buffer close
Dostanete řádek podobný tomuto:
/key meta-y /buffer close
9. Pluginy/skripty
Na některých distibucích jako Debian, jsou pluginy dostupné v samostatném
balíčku (jako weechat-plugins).
Pluginy jsou automatikcy načteny při nalezení.
Pro WeeChat je dostupných spousta pluginů/skriptů, více na:
http://weechat.flashtux.org/plugins.php
Pro načítání/rušení pluginů/skriptů se podívejde do dokumentace WeeChat.
10. Další dokumentace
Nyní můžete používat WeeChat a číst FAQ/dokumentaci v případě dalších dotazů:
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Uživejte si WeeChat!
--
(c) 2006-05-31, napsal FlashCode <flashcode@flashtux.org>, přeložil GolemJ <golemj@gmail.com>
This document is part of WeeChat and is distributed under GPL licence.
Tento dokunet je součástí WeeChat a je distribuován pod licencí GPL.
+6 -4
View File
@@ -18,8 +18,9 @@
LANGCODE = de
BOOK = weechat.$(LANGCODE)
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE)
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
@@ -30,7 +31,7 @@ all-local: html-stamp
html: html-stamp
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
echo "<pubdate>`date -R`</pubdate>" >date.xml
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html/
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
cp ../weechat-doc.css html/
@@ -41,7 +42,7 @@ html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
html1: html1-stamp
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
echo "<pubdate>`date -R`</pubdate>" >date.xml
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html1/
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
cp ../weechat-doc.css html1/
@@ -52,10 +53,11 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
# clean
clean-local:
-rm -f *.html *.pdf *.txt date.xml
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
-rm -rf html/ html1/
-rm -f html-stamp html1-stamp
+15 -1
View File
@@ -5,6 +5,13 @@
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><option>look_save_on_exit</option></entry>
<entry>Boolean</entry>
<entry></entry>
<entry>'on'</entry>
<entry>Konfiguration beim Verlassen abspeichern</entry>
</row>
<row>
<entry><option>look_set_title</option></entry>
<entry>Boolean</entry>
@@ -953,7 +960,7 @@
<row>
<entry><option>dcc_timeout</option></entry>
<entry>Ganzzahl</entry>
<entry>zwischen 1 und 2147483647</entry>
<entry>zwischen 5 und 2147483647</entry>
<entry>300</entry>
<entry>DCC-Timeout in Sekunden</entry>
</row>
@@ -964,6 +971,13 @@
<entry>65536</entry>
<entry>Blockgröße für DCCs</entry>
</row>
<row>
<entry><option>dcc_fast_send</option></entry>
<entry>Boolean</entry>
<entry>zwischen 1024 und 102400</entry>
<entry>'on'</entry>
<entry>Warte beim Veschicken von Dateien nicht auf das ACK-Signal</entry>
</row>
<row>
<entry><option>dcc_port_range</option></entry>
<entry>Zeichenfolge</entry>
+1100 -48
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -20,9 +20,9 @@ Puffer verwalten
Aktion: Pufferaktion:
move: Puffer in der Liste bewegen (kann auch relativ sein, wie -1)
close: Puffer schließen (und Channel ohne Meldung verlassen)
close: Puffer schließen (eine Part-Message kann optional angegeben werden)
list: alle offenen Puffer auflisten (Standardaktion)
notify: Notify-Level für Puffer festlegen (0=nie, 1=highlighten, 2=1+Nachricht, 3=2+join/part)
notify: Notify-Level für Puffer festlegen (0=nie, 1=bei hervorgehobenen Nachrichten, 2=1+persönliche Nachricht, 3=2+join/part)
Server
Channel: gehe zum Puffer mit Servernamen oder Channelnamen
Nummer: gehe zu Puffer mit dieser Nummer
@@ -227,7 +227,7 @@ Fenster verwalten
right: wechselt zum rechten Fenster
splith: teilt das aktuelle Fenster horizontal
splitv: teilt das aktuelle Fenster vertikal
resize: verändert die Größe des aktuellen Fensters, die neue Größe wird in Prozent des Elternfensters angegeben
resize: verändert die Größe des aktuellen Fensters, die neue Größe ist &lt;pct&gt; Prozent des Elternfensters groß
merge: vereinigt Fenster miteinander (all = alle Fenster vereinigen)
Bei splith und splitv gibt pct die neue Größe des Fensters im verhältnis zur aktuellen Größe an. Zum Beispiel würde 25 bedeuten, dass das neue Fenster nur noch ein Viertel der Größe des alten Fensters hätte.
+109
View File
@@ -0,0 +1,109 @@
WeeChat Schnellstarter (deutsche Version)
======================
1. Weechat starten
Entsprechend dem gewählten User-Interface müssen Du starten:
- weechat-curses für das Curses GUI
- weechat-gtk für das Gtk GUI (in Entwicklung)
- weechat-qt für das Qt GUI (in Planung)
- weechat-wxwidgets für das WxWidgets GUI (in Planung)
2. Online-Hilfe / Optionen
WeeChat hat eine eingebaute Hilfe für all Kommandos, tippe einfach /help
Um Hilfe zu einem Kommando zu bekommen, tippe /help Kommando
Um Optionen zu verändern, benutzt du /set Option = Wert
Du brauchst /set Option nur mit den Anfangsbuchstaben eingeben
(<tab> zeigt alle Optionen mit den gleichen Buchstaben) oder mit dem vollen
Namen ohne einen Wert, um eine ausführliche Hilfe zu bekommen.
Wichtig: die Einstellungen werden gespeichert, wenn WeeChat beendet wird
(oder mit dem Befehl /save). Verändere die Einstellungen nicht, wenn WeeChat
läuft, weil WeeChat diese Datei zu jeder Zeit überschreiben kann und
Änderungen verloren sind. Um irgendeine Einstellung zu verändern, verwendest du
das /set Kommando, WeeChat wird die neuen Einstellungen umgehend übernehmen.
3. Einen Server-Eintrag anlegen
Zum Beispiel für irc.quakenet.org, Port 6667:
/server quakenet irc.quakenet.org 6667
(/help Server für volle Hilfe zu diesem Kommando)
4. Eigene Server-Optionen setzen
Nickname:
/set quakenet.server_nick1 = "mynick"
/set quakenet.server_nick2 = "mynick2"
/set quakenet.server_nick3 = "mynick3"
Username/Klarname:
/set quakenet.server_username = "My username"
/set quakenet.server_realname = "My real name"
Automatische Server-Verbindung:
/set quakenet.server_autoconnect = on
Automatisches Betreten eines Channels:
/set quakenet.server_autojoin = "#chan1,#chan2"
Andere Optionen:
Du kannst die Server-Optionen und ihre Werte mit /set quakenet sehen
Um eine Option zu setzen, tippe /set quakenet.option = Wert
5. Verbinden zu einem Server und automatisch einen Channel betreten
/connect quakenet
6. Channels betreten/verlassen
Einen Channel betreten:
/join #channel
Einen Channel verlassen:
/part [Nachricht]
Einen Channel verlassen und den Buffer schliessen:
/close [Nachricht]
(/close ist ein Alias für /buffer close)
7. Buffer/Fenster Management
Du kannst die einzelnen Buffer mit /buffer und Fenster mit /window
verwalten.
Um zum Beispiel das Fenster in ein kleineres (1/3 breit) und ein
grosses (2/3 breit) zu teilen, nutzt du das folgende Kommando:
/window splitv 33
8. Tastenkombinationen
Entsprechend deiner Tastatur und/oder deinen Wünschen, kannst du jede Taste
mit "/key" neu zuordnen.
Eine nützliche Taste ist meta-k (alt-k), sie zeigt die Tastaturcodes an.
Um zum Beispiel meta-y (alt-y) dem Kommando "/buffer close" zuzuordnen:
/key (tippe meta-k) (tippe meta-y) /buffer close
Und du bekommst damit die Kommandozeile:
/key meta-y /buffer close
9. Plugins/Skripte
In einigen Distributionen, wie zum Beispiel Debian, sind Plugins in separaten
Paketen verfügbar (wie weechat-plugins). Plugins werden automatisch geladen,
wenn welche gefunden wurden.
Viele Plugins/Skripte für WeeChat sind zu finden auf:
http://weechat.flashtux.org/plugins.php
Bitte lies für das Laden/Entladen von Plugins oder Skripten die Dokumentation.
10. Mehr Dokumentation
Jetzt kannst du WeeChat starten und die FAQ/Dokumentation lesen, falls du weitere
Fragen hast:
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Viel Spass mit WeeChat!
--
(c) 2006-05-31, written by FlashCode <flashcode@flashtux.org>
This document is part of WeeChat and is distributed under GPL licence.
+6 -4
View File
@@ -18,8 +18,9 @@
LANGCODE = en
BOOK = weechat.$(LANGCODE)
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE)
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
@@ -30,7 +31,7 @@ all-local: html-stamp
html: html-stamp
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
echo "<pubdate>`date -R`</pubdate>" >date.xml
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html/
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
cp ../weechat-doc.css html/
@@ -41,7 +42,7 @@ html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
html1: html1-stamp
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
echo "<pubdate>`date -R`</pubdate>" >date.xml
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html1/
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
cp ../weechat-doc.css html1/
@@ -52,10 +53,11 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
# clean
clean-local:
-rm -f *.html *.pdf *.txt date.xml
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
-rm -rf html/ html1/
-rm -f html-stamp html1-stamp
+15 -1
View File
@@ -5,6 +5,13 @@
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><option>look_save_on_exit</option></entry>
<entry>boolean</entry>
<entry>'on' or 'off'</entry>
<entry>'on'</entry>
<entry>Save config file on exit</entry>
</row>
<row>
<entry><option>look_set_title</option></entry>
<entry>boolean</entry>
@@ -953,7 +960,7 @@
<row>
<entry><option>dcc_timeout</option></entry>
<entry>integer</entry>
<entry>between 1 and 2147483647</entry>
<entry>between 5 and 2147483647</entry>
<entry>300</entry>
<entry>Timeout for dcc request (in seconds)</entry>
</row>
@@ -964,6 +971,13 @@
<entry>65536</entry>
<entry>Block size for dcc packets in bytes (default: 65536)</entry>
</row>
<row>
<entry><option>dcc_fast_send</option></entry>
<entry>boolean</entry>
<entry>'on' or 'off'</entry>
<entry>'on'</entry>
<entry>Does not wait for ACK when sending file</entry>
</row>
<row>
<entry><option>dcc_port_range</option></entry>
<entry>string</entry>
+1102 -50
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -21,7 +21,7 @@ manage buffers
action: action to do:
move: move buffer in the list (may be relative, for example -1)
close: close buffer (optional arg is part message, for a channel)
list: list opened buffers (no parameter implies this list)
list: list open buffers (no parameter implies this list)
notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)
server
channel: jump to buffer by server and/or channel name
@@ -216,7 +216,7 @@ show WeeChat uptime
<programlisting>
manage windows
list: list opened windows (no parameter implies this list)
list: list open windows (no parameter implies this list)
-1: jump to previous window
+1: jump to next window
b#: jump to next window displaying buffer number #
+107
View File
@@ -0,0 +1,107 @@
WeeChat quick start guide (english version)
=========================
1. Launch weechat
According to choosed GUI, you have to launch:
- weechat-curses for Curses GUI
- weechat-gtk for Gtk GUI (under development)
- weechat-qt for Qt GUI (not developed)
- weechat-wxwidgets for WxWidgets GUI (not developed)
2. Online help / options
WeeChat has help for all commands, just issue /help
To get help on a command, issue /help command
To set options, use /set option = value
You can use /set option with partial name (display all options
containg letters), or with only a full option name without value
(to see long help for option).
Important note: settings are saved when WeeChat ends (or with "/save"
command). Do NOT edit setup file while WeeChat is running, because WeeChat
may write this file at any time, and it's not possible to reload it.
To change any settings, use "/set" command, WeeChat immediately uses new
settings.
3. Create a server
For example irc.quakenet.org, port 6667:
/server quakenet irc.quakenet.org 6667
(/help server for full command help)
4. Set custom server options
Nicks:
/set quakenet.server_nick1 = "mynick"
/set quakenet.server_nick2 = "mynick2"
/set quakenet.server_nick3 = "mynick3"
Username/realname:
/set quakenet.server_username = "My username"
/set quakenet.server_realname = "My real name"
Auto-connect to server:
/set quakenet.server_autoconnect = on
Auto-join for some channels:
/set quakenet.server_autojoin = "#chan1,#chan2"
Other options:
You can see servers options and values with /set quakenet
To set an option, use /set quakenet.server_option = value
5. Connect to server and auto-join channels:
/connect quakenet
6. Join/part channels
Join a channel:
/join #channel
Part a channel:
/part [quit message]
Part a channel and close buffer:
/close [quit message]
(/close is an alias on /buffer close)
7. Buffer/window management
You can manage buffers with "/buffer" command and windows
with "/window" command.
For example, to split verticaly screen into a small window (1/3 width),
and a large (2/3), use command:
/window splitv 33
8. Key bindings
According to your keyboard and/or your needs, you can rebind any key
with "/key" command.
A useful key is meta-k (alt-k) to find key codes.
For example, to bind meta-y (alt-y) to command "/buffer close":
/key (press meta-k) (press meta-y) /buffer close
You'll have a command line like:
/key meta-y /buffer close
9. Plugins/scripts
On some distros like Debian, plugins are available via a separate package
(like weechat-plugins).
Plugins are automatically loaded when found.
Many plugins/scripts are available for WeeChat, please look at:
http://weechat.flashtux.org/plugins.php
Please look at WeeChat documentation to load/unload plugins or scripts.
10. More documentation
You can now use WeeChat and read FAQ/documentation for any other question:
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Enjoy WeeChat!
--
(c) 2006-05-31, written by FlashCode <flashcode@flashtux.org>
This document is part of WeeChat and is distributed under GPL licence.
+6 -4
View File
@@ -18,8 +18,9 @@
LANGCODE = fr
BOOK = weechat.$(LANGCODE)
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE)
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE) $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
@@ -30,7 +31,7 @@ all-local: html-stamp
html: html-stamp
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
echo "<pubdate>`date -R`</pubdate>" >date.xml
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html/
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
cp ../weechat-doc.css html/
@@ -41,7 +42,7 @@ html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
html1: html1-stamp
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
echo "<pubdate>`date -R`</pubdate>" >date.xml
echo "<pubdate>`date '+%F %T'`</pubdate>" >date.xml
mkdir -p html1/
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
cp ../weechat-doc.css html1/
@@ -52,10 +53,11 @@ html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.
install-data-hook:
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
# clean
clean-local:
-rm -f *.html *.pdf *.txt date.xml
-rm -f $(BOOK).html $(BOOK).pdf $(BOOK).txt date.xml
-rm -rf html/ html1/
-rm -f html-stamp html1-stamp
+15 -1
View File
@@ -5,6 +5,13 @@
This file is automatically built with a Perl script. DO NOT EDIT!
-->
<row>
<entry><option>look_save_on_exit</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>Sauvegarder la configuration en quittant</entry>
</row>
<row>
<entry><option>look_set_title</option></entry>
<entry>booléen</entry>
@@ -953,7 +960,7 @@
<row>
<entry><option>dcc_timeout</option></entry>
<entry>entier</entry>
<entry>entre 1 et 2147483647</entry>
<entry>entre 5 et 2147483647</entry>
<entry>300</entry>
<entry>Délai d'attente pour les requêtes dcc (en secondes)</entry>
</row>
@@ -964,6 +971,13 @@
<entry>65536</entry>
<entry>Taille de bloc pour les paquets dcc en octets (défaut: 65536)</entry>
</row>
<row>
<entry><option>dcc_fast_send</option></entry>
<entry>booléen</entry>
<entry>'on' ou 'off'</entry>
<entry>'on'</entry>
<entry>N'attend pas les accusés de réception lors de l'envoi de fichier</entry>
</row>
<row>
<entry><option>dcc_port_range</option></entry>
<entry>chaîne</entry>
+1119 -48
View File
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -19,13 +19,13 @@ param
gestion des tampons
action: action à effectuer:
move: déplacer le tampon dans la liste (peut être relatif, par exemple -1)
close: fermer le tampon (le paramètre optionnel est le message de fin, pour un canal)
move: déplace le tampon dans la liste (peut être relatif, par exemple -1)
close: ferme le tampon (le paramètre optionnel est le message de fin, pour un canal)
list: liste les tampons ouverts (pas de paramètre affiche cette liste)
notify: fixer le niveau de notification (0=jamais, 1=highlight, 2=1+msg, 3=2+join/part)
notify: fixe le niveau de notification (0=jamais, 1=highlight, 2=1+msg, 3=2+join/part)
serveur
canal: sauter au tampon par serveur et/ou nom de canal
nombre: sauter au tampon qui a ce numéro
canal: saute au tampon par serveur et/ou nom de canal
nombre: saute au tampon qui a ce numéro
</programlisting>
<command>builtin commande</command>
+110
View File
@@ -0,0 +1,110 @@
Guide de démarrage rapide WeeChat (version française)
=================================
1. Démarrer weechat
Selon l'interface choisie, vous devez lancer :
- weechat-curses pour l'interface Curses
- weechat-gtk pour l'interface Gtk (en développement)
- weechat-qt pour l'interface Qt (non développée)
- weechat-wxwidgets pour l'interface WxWidgets (non développée)
2. Aide en ligne / options
WeeChat dispose d'aide pour toutes les commandes, tapez simplement /help
Pour avoir de l'aide sur une commande, tapez /help commande
Pour modifier des options, utilisez /set option = valeur
Vous pouvez utiliser /set avec un nom partiel d'option (affiche alors
les options contenant ces lettres), ou avec un nom complet d'option
sans valeur (pour voir l'aide complète de l'option).
Note importante: les options sont sauvées lorsque WeeChat quitte (ou avec
la commande "/save"). N'éditez PAS le fichier de configuration pendant que
WeeChat tourne, car WeeChat peut écrire ce fichier à tout moment, et il
n'est pas possible de le recharger.
Pour changer toute option, utilisez la commande "/set", WeeChat prend en
compte immédiatement les nouvelles valeurs.
3. Créer un serveur
Par exemple irc.quakenet.org, port 6667:
/server quakenet irc.quakenet.org 6667
(/help server pour l'aide complète sur la commande)
4. Définir les options du serveur
Pseudos :
/set quakenet.server_nick1 = "mynick"
/set quakenet.server_nick2 = "mynick2"
/set quakenet.server_nick3 = "mynick3"
Nom d'utilisateur/réel :
/set quakenet.server_username = "Mon nom d'utilisateur"
/set quakenet.server_realname = "Mon nom réel"
Connexion auto au serveur :
/set quakenet.server_autoconnect = on
Rejoindre automatiquement des canaux :
/set quakenet.server_autojoin = "#canal1,#canal2"
Autres options :
Vous pouvez voir les options du serveur et les valeurs avec /set quakenet
Pour modifier une option, utilisez /set quakenet.server_option = valeur
5. Se connecter au serveur et rejoindre les canaux :
/connect quakenet
6. Rejoindre/quittre les canaux
Joindre un canal :
/join #channel
Quitter un canal :
/part [message de fin]
Quitter un canal et fermer le tampon :
/close [message de fin]
(/close est un alias sur /buffer close)
7. Gérer les tampons/fenêtres
Vous pouvez gérer les tampons avec la commande "/buffer" et les fenêtres
avec la commande "/window".
Par exemple, pour découper verticalement l'écran en une petite fenêtre
(1/3 de la largeur) et une large (2/3 de la largeur), utilisez la commande
/window splitv 33
8. Gérer les raccourcis clavier
Selon votre clavier et vos besoins, vous pouvez associer n'importe quelle
touche à une commande avec la commande "/key".
Une touche utile est meta-k (alt-k) pour trouver le code des touches.
Par exemple, pour associer meta-y (alt-y) à la commande "/buffer close" :
/key (pressez meta-k) (pressez meta-y) /buffer close
Vous aurez une ligne de commande qui ressemble à ceci :
/key meta-y /buffer close
9. Extensions/scripts
Sur certaines distributions comme Debian, les extensions sont disponibles
via un paquet séparé (par exemple weechat-plugins).
Les extensions sont automatiquement chargées lorsqu'elles sont trouvées.
Plusieurs extensions/scripts sont disponibles pour WeeChat, voir ici :
http://weechat.flashtux.org/plugins.php
Merci de regarder la documentation WeeChat pour charger/décharget des
extensions ou des scripts.
10. Plus de documentation
Vous pouvez maintenant utiliser WeeChat et lire la FAQ/documentation pour
toute autre question :
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Bon WeeChat !
--
(c) 2006-05-31, écrit par FlashCode <flashcode@flashtux.org>
Ce document fait partie de WeeChat et est distribué sous license GPL.
+28
View File
@@ -0,0 +1,28 @@
# 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
#
LANGCODE = pl
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
# install docs
install-data-hook:
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
+111
View File
@@ -0,0 +1,111 @@
Weechat szybki start (wersja polska)
1. Włączenie
Aby wybrać konkretny interfejs należy wpisać:
- weechat-curses dla interfejsu curses
- weechat-gtk dla interfejsu GTK (w fazie tworzenia)
- weechat-qt dla interfejsu QT (planowany)
- weechat-wxwidgets dla interfejsu WxWidgets (planowany)
2. Pomoc online / opcje
Weechat posiada polecenie pomocy, którego można użyć dla każdej dostępnej opcji, wystarczy wpisać /help
Aby otrzymać pomoc odnośnie komendy, wpisz /help <komenda>
Aby konfigurować opcje należy wpisać /set <opcja> = <wartość>
Możesz wpisać /set <opcja> z nie pełną nazwą opcji (pokaże to opcje zawierające wpisany ciąg znaków),
lub z całą nazwą opcji bez wartości (pokaże sie wtedy cała pomoc odnośnie opcji).
Uwaga: ustawienia są zapamiętywane podczas wyłączania WeeChata (albo po wpisaniu /save )
NIE EDYTUJ pliku konfiguracyjnego WeeChata podczas pracy programu, ponieważ WeeChat może nadpisać
ten plik w każdej chwili i nie będzie możliwości odzyskania ustawień.
Aby zmienić każde z ustawień, używaj komendy "/set", WeeChat po jej użyciu od razu zacznie korzystać z nowych
parametrów.
3. Dodawanie serwerów
Dla przykładu irc.quakenet.org, port 6667:
/server quakenet irc.quakenet.org 6667
(wpisz /help server dla pełnej pomocy)
4. Ustawianie własnych ustawień dotyczących serwera
Niki:
/set quakenet.server_nick1 = "mój-nick"
/set quakenet.server_nick2 = "mój-nick2"
/set quakenet.server_nick3 = "mój-nick3"
Imię użytkownika:
/set quakenet.server_username = "My username"
/set quakenet.server_realname = "My real name"
Automatyczne łączenie do serwera przy starcie WeeChata:
/set quakenet.server_autoconnect = on
Automatyczne wchodzenie na wybrane kanały po połączeniu sie do serwera:
/set quakenet.server_autojoin = "#kanał1,#kanał2"
Inne opcje:
Możesz zobaczyć inne opcje i ich właściwości po wpisaniu /set quakenet
Aby ustawić konkretną opcję wpisz /set quakenet.server_opcja = wartość
5. Łączenie do serwera i automatyczne wchodzenie na wybrane kanały:
/connect quakenet
6. Wchodzenie/wychodzenie na/z kanały/-ów
Wchodzenie na kanał:
/join #kanał
Wychodzenie z kanału:
/part {wiadomość przy wychodzeniu}
Wyjście z kanału i zamknięcie zakładki:
/close {wiadomość przy wychodzeniu}
("/close" to alias od "/bufer close")
7. Zarządzanie bufory/okna
Możesz zarządzać buforami przy pomocy polecenia "/buffer" i oknami "/windows"
Przykład:
-aby rozdzielić ekran w pionie na małe okno (1/3 szerokości),
i na duże (2/3), wpisz:
/window splthv 33
8. Przypisywanie funkcji do klawiszy:
W celu łatwiejszej pracy można przypisać dowolnym klawiszom wybrane funkcje/polecenia
przy pomocy komendy "/key"
Użyteczną może być funkcja meta-k (alt+k) która pozwala znaleźć przypisane klawiszom kody.
Przykład: aby zbindować (przypisać) meta-y (alt-y) do polecenia "/buffer close":
/key (naciśnij meta-k) (naciśnij meta-y) /buffer close
Otrzymujesz:
/key meta-y /buffer close
9. Wtyczki/skrypty
Na niektórych systemach operacyjnych, takich jak Debian, wtyczki są dostępne jako oddzielne paczki
(np. weechat-plugins)
Wtyczki są automatycznie ładowane przy starcie.
Dodatkowe skrypty i wtyczki do WeeChata dostępne są na:
http://weechat.flashtux.org/plugins.php
Zajrzyj do dokumentacji WeeChata, aby dowiedzieć sie jak ladować i wyładować wtyczki i skrypty:
http://weechat.flashtux.org/doc.php
10. Dokumentacja szczegółowa
Wiesz juz jak w podstawowy sposób używać WeeChata, aby dowiedzieć sie więcej poczytaj dokumentację.
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Miłej pracy z WeeChatem!
--
(c) 2006-05-31, written by FlashCode <flashcode@flashtux.org>
Translated by dzik (znajdziecie mnie na irc.freenode.net)
This document is part of WeeChat and is distributed under GPL licence.
+28
View File
@@ -0,0 +1,28 @@
# 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
#
LANGCODE = ru
QUICKSTART = weechat_quickstart.$(LANGCODE).txt
EXTRA_DIST = $(QUICKSTART)
docdir = $(datadir)/doc/$(PACKAGE)
# install docs
install-data-hook:
$(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/
+110
View File
@@ -0,0 +1,110 @@
Краткое руководство пользователя (русская версия)
================================
1. Запуск WeeChat
В зависимости от выбранного интерфейса вы должны запустить:
- weechat-curses для Curses интерфейса
- weechat-gtk для GTK интерфейса (в разработке)
- weechat-qt для Qt интерфейса (не разрабатывается)
- weechat-wxwidgets для WxWidgets интерфейса (не разрабатывается)
2. Справка / настройки
WeeChat содержит справку по всем командам, просто запустите /help
Для получения справки по команде наберите /help команда
Для настройки используйте /set параметр = значение
Вы можете использовать /set с частичным названием параметра
(выведет все параметры с указанной фразой) или с полным названием
(для получения подробной справки по параметру)
Внимание: настройки сохраняются при выходе из WeeChat (или командой
"/save"). НЕ РЕДАКТИРУЙТЕ файл конфигурации когда WeeChat запущен,
т.к. WeeChat может в любой момент перезаписать его. Возможности
перезагрузить файл конфигурации нет. Для изменения любых настроек
воспользуйтесь командой "/set", изменения вступят в силу
незамедлительно.
3. Создание сервера
Например, irc.quakenet.org, порт 6667:
/server quakenet irc.quakenet.org 6667
(/help server выведет подробную справку)
4. Настройка сервера
Ники:
/set quakenet.server_nick1 = "mynick"
/set quakenet.server_nick2 = "mynick2"
/set quakenet.server_nick3 = "mynick3"
Имя пользователя / реальное имя:
/set quakenet.server_username = "Имя пользователя"
/set quakenet.server_realname = "Реальное имя"
Автоматическое подключение к серверу:
/set quakenet.server_autoconnect = on
Автоматический заход на некоторые каналы:
/set quakenet.server_autojoin = "#chan1,#chan2"
Другие настройки:
Чтобы вывести все настройки сервера наберите /set quakenet
Для настройки наберите /set quakenet.параметр_сервера = значение
5. Подключение к серверу и автоматический заход на каналы:
/connect quakenet
6. Заход/покидание каналов
Зайти на канал:
/join #канал
Покинуть канал:
/part [прощальное сообщение]
Покинуть канал и закрыть буфер:
/close [прощальное сообщение]
(/close - это сокращение для /buffer close)
7. Управление буферами/окнами
Вы можете управлять буферами командой "/buffer" и окнами
командой "/window".
Например, чтобы разбить экран по вертикали на маленькое (треть
экрана) и большое (2/3 экрана) окна наберите:
/window splitv 33
8. Привязки клавиш
Вы можете переназначить любую клавишу в соответствии с вашими
пожеланиями командой "/key".
Полезна привязка meta-k (alt-k) для поиска нужных кодов клавиш.
Например, чтобы привязать meta-y (alt-y) к команде "/buffer close":
/key (нажмите meta-k) (нажмите meta-y) /buffer close
Вы получите команду:
/key meta-y /buffer close
9. Plugins/скрипты
В некоторых дистрибутивах pluginы доступны отдельным пакетом
(например, weechat-plugins).
Pluginы загружаются автоматически.
Для WeeChat доступны многочисленные pluginы и скрипты:
http://weechat.flashtux.org/plugins.php
Процесс загрузки и выгрузки pluginов и скриптов подробно описан в
документации.
10. Другая документация
Теперь вы можете пользоваться WeeChat и почитать ЧаВо и документацию
для поиска ответов на оставшиеся вопросы:
http://weechat.flashtux.org/faq.php
http://weechat.flashtux.org/doc.php
Наслаждайтесь WeeChat!
--
(c) 2006-05-31, автор - FlashCode <flashcode@flashtux.org>
(с) 2006-06-04, переводчик - Stalwart <stlwrt@gmail.com>
Этот документ является частью WeeChat и распространяется по лицензии GPL.
+1 -1
View File
@@ -1,4 +1,4 @@
.TH WEECHAT 1 "May 2006" "FlashCode"
.TH WEECHAT 1 "August 2006" "FlashCode"
.SH NAME
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
@@ -2,7 +2,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl"/>
<xsl:import href="@DOC_XSL_PREFIX@/html/docbook.xsl"/>
<xsl:output indent="yes"/>
@@ -2,7 +2,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl"/>
<xsl:import href="@DOC_XSL_PREFIX@/html/chunk.xsl"/>
<xsl:output indent="yes"/>
+3
View File
@@ -1,3 +1,4 @@
./src/irc/irc-mode.c
./src/irc/irc-nick.c
./src/irc/irc-server.c
./src/irc/irc-channel.c
@@ -67,6 +68,8 @@
./src/common/session.h
./src/common/utf8.c
./src/common/utf8.h
./src/common/util.c
./src/common/util.h
./src/common/weechat.c
./src/common/weechat.h
./src/common/weeconfig.c
+1356 -1242
View File
File diff suppressed because it is too large Load Diff
+1335 -1239
View File
File diff suppressed because it is too large Load Diff
+1334 -1237
View File
File diff suppressed because it is too large Load Diff
+1355 -1247
View File
File diff suppressed because it is too large Load Diff
+1350 -1399
View File
File diff suppressed because it is too large Load Diff
+1378 -1270
View File
File diff suppressed because it is too large Load Diff
+1146 -1225
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -42,4 +42,6 @@ lib_weechat_main_a_SOURCES = weechat.c \
session.c \
session.h \
utf8.c \
utf8.h
utf8.h \
util.c \
util.h
+9
View File
@@ -65,6 +65,7 @@ weechat_backtrace_printf (char *message, ...)
void
weechat_backtrace_addr2line (int number, void *address, char *symbol)
{
#ifdef HAVE_BACKTRACE
int rc;
Dl_info info;
const void *addr;
@@ -129,6 +130,12 @@ weechat_backtrace_addr2line (int number, void *address, char *symbol)
weechat_backtrace_printf ("%03d %s\n",
number, function_name);
pclose (output);
#else
/* make gcc happy */
(void) number;
(void) address;
(void) symbol;
#endif
}
/*
@@ -145,6 +152,8 @@ weechat_backtrace ()
#endif
weechat_backtrace_printf ("======= WeeChat backtrace =======\n");
weechat_backtrace_printf ("(written by %s, compiled on %s %s)\n",
PACKAGE_STRING, __DATE__, __TIME__);
#ifdef HAVE_BACKTRACE
trace_size = backtrace (trace, BACKTRACE_MAX);
+176 -35
View File
@@ -34,6 +34,7 @@
#include "log.h"
#include "session.h"
#include "utf8.h"
#include "util.h"
#include "weelist.h"
#include "weeconfig.h"
#include "../irc/irc.h"
@@ -59,7 +60,7 @@ t_weechat_command weechat_commands[] =
N_(" action: action to do:\n"
" move: move buffer in the list (may be relative, for example -1)\n"
" close: close buffer (optional arg is part message, for a channel)\n"
" list: list opened buffers (no parameter implies this list)\n"
" list: list open buffers (no parameter implies this list)\n"
" notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
"server\n"
"channel: jump to buffer by server and/or channel name\n"
@@ -128,6 +129,15 @@ t_weechat_command weechat_commands[] =
" reset: restore bindings to the default values and delete ALL "
"personal bindings (use carefully!)"),
"unbind|functions|reset %k", 0, MAX_ARGS, 0, NULL, weechat_cmd_key },
/* { "panel", N_("manage panels"),
N_("[list | add type position size | resize # size | close # | move #1 #2]"),
N_(" list: list open panels (no parameter implies this list)\n"
" add: add a panel, type is global|local, position is top|bottom|left|right\n"
" resize: resize a panel with a new size (may be relative, for example -1)\n"
" close: close a panel by number\n"
" move: move a panel to another number (may be relative, for example -1)"),
"list|add|close|move global|local top|bottom|left|right",
0, MAX_ARGS, 0, weechat_cmd_panel, NULL },*/
{ "plugin", N_("list/load/unload plugins"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: WeeChat plugin (file) to load\n\n"
@@ -195,7 +205,7 @@ t_weechat_command weechat_commands[] =
{ "window", N_("manage windows"),
N_("[list | -1 | +1 | b# | up | down | left | right | splith [pct] "
"| splitv [pct] | resize pct | merge [all]]"),
N_(" list: list opened windows (no parameter implies this list)\n"
N_(" list: list open windows (no parameter implies this list)\n"
" -1: jump to previous window\n"
" +1: jump to next window\n"
" b#: jump to next window displaying buffer number #\n"
@@ -674,7 +684,8 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
int only_builtin)
{
int i, rc, argc, argc2, return_code, length1, length2;
char *command, *pos, *ptr_args, *ptr_args2, **argv, **argv2, *alias_command;
char *command, *pos, *ptr_args, *ptr_args2, *ptr_args3;
char **argv, **argv2, *alias_command;
char **commands, **ptr_cmd, **ptr_next_cmd;
t_weechat_alias *ptr_alias;
@@ -842,11 +853,16 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
}
else
{
ptr_args2 = (weechat_commands[i].charset_conversion && ptr_args) ?
ptr_args2 = (weechat_commands[i].conversion && ptr_args) ?
channel_iconv_encode (server, channel, ptr_args) : NULL;
ptr_args3 = (weechat_commands[i].conversion
&& cfg_irc_colors_send && ptr_args) ?
(char *)gui_color_encode ((ptr_args2) ? (unsigned char *)ptr_args2 :
(unsigned char *)ptr_args) : NULL;
if (weechat_commands[i].cmd_function_args)
{
argv2 = explode_string ((ptr_args2) ? ptr_args2 : ptr_args,
argv2 = explode_string ((ptr_args3) ? ptr_args3 :
((ptr_args2) ? ptr_args2 : ptr_args),
" ", 0, &argc2);
return_code = (int) (weechat_commands[i].cmd_function_args)
(server, channel, argc2, argv2);
@@ -854,7 +870,8 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
}
else
return_code = (int) (weechat_commands[i].cmd_function_1arg)
(server, channel, (ptr_args2) ? ptr_args2 : ptr_args);
(server, channel, (ptr_args3) ? ptr_args3 :
((ptr_args2) ? ptr_args2 : ptr_args));
if (return_code < 0)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
@@ -864,6 +881,8 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
}
if (ptr_args2)
free (ptr_args2);
if (ptr_args3)
free (ptr_args3);
}
free_exploded_string (argv);
free (command);
@@ -929,11 +948,16 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
free (command);
return 0;
}
ptr_args2 = (irc_commands[i].charset_conversion && ptr_args) ?
ptr_args2 = (irc_commands[i].conversion && ptr_args) ?
channel_iconv_encode (server, channel, ptr_args) : NULL;
ptr_args3 = (irc_commands[i].conversion
&& cfg_irc_colors_send && ptr_args) ?
(char *)gui_color_encode ((ptr_args2) ? (unsigned char *)ptr_args2 :
(unsigned char *)ptr_args) : NULL;
if (irc_commands[i].cmd_function_args)
{
argv2 = explode_string ((ptr_args2) ? ptr_args2 : ptr_args,
argv2 = explode_string ((ptr_args3) ? ptr_args3 :
((ptr_args2) ? ptr_args2 : ptr_args),
" ", 0, &argc2);
return_code = (int) (irc_commands[i].cmd_function_args)
(server, channel, argc2, argv2);
@@ -941,7 +965,8 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
}
else
return_code = (int) (irc_commands[i].cmd_function_1arg)
(server, channel, (ptr_args2) ? ptr_args2 : ptr_args);
(server, channel, (ptr_args3) ? ptr_args3 :
((ptr_args2) ? ptr_args2 : ptr_args));
if (return_code < 0)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
@@ -951,6 +976,8 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
}
if (ptr_args2)
free (ptr_args2);
if (ptr_args3)
free (ptr_args3);
}
free_exploded_string (argv);
free (command);
@@ -1346,10 +1373,10 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
{
/* list opened buffers */
/* list open buffers */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Opened buffers:\n"));
gui_printf (NULL, _("Open buffers:\n"));
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
@@ -1423,7 +1450,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s can not close server buffer while channels "
"are opened\n"),
"are open\n"),
WEECHAT_ERROR);
free_exploded_string (argv);
return -1;
@@ -1449,9 +1476,10 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
if (CHANNEL(buffer)
&& (CHANNEL(buffer)->type == CHANNEL_TYPE_DCC_CHAT))
{
ptr_server = SERVER(buffer);
ptr_channel = CHANNEL(buffer);
gui_buffer_free (ptr_channel->buffer, 1);
channel_free (SERVER(buffer), ptr_channel);
channel_free (ptr_server, ptr_channel);
gui_status_draw (gui_current_window->buffer, 1);
gui_input_draw (gui_current_window->buffer, 1);
}
@@ -1810,11 +1838,32 @@ weechat_cmd_charset_display (t_gui_buffer *buffer)
/*
* weechat_cmd_charset_set: set a charset for server or channel
* from_internal == 1 if charset is used to encode data,
* 0 if charset is used to decode data
*/
void
weechat_cmd_charset_set (t_gui_buffer *buffer, char **string, char *charset)
int
weechat_cmd_charset_set (t_gui_buffer *buffer, char **string, char *charset,
int from_internal)
{
int iconv_ok;
if (charset)
{
if (from_internal)
iconv_ok = weechat_iconv_check (NULL, charset);
else
iconv_ok = weechat_iconv_check (charset, NULL);
if (!iconv_ok)
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s charset \"%s\" is not available\n"),
WEECHAT_ERROR, charset);
return -1;
}
}
if (BUFFER_IS_SERVER(buffer))
{
if (charset)
@@ -1832,6 +1881,7 @@ weechat_cmd_charset_set (t_gui_buffer *buffer, char **string, char *charset)
config_option_list_remove (string, CHANNEL(buffer)->name);
weechat_cmd_charset_display (buffer);
}
return 0;
}
/*
@@ -1843,6 +1893,7 @@ weechat_cmd_charset (t_irc_server *server, t_irc_channel *channel,
int argc, char **argv)
{
t_gui_buffer *buffer;
int rc;
irc_find_context (server, channel, NULL, &buffer);
@@ -1851,17 +1902,17 @@ weechat_cmd_charset (t_irc_server *server, t_irc_channel *channel,
else
{
if (ascii_strcasecmp (argv[0], "decode_iso") == 0)
weechat_cmd_charset_set (buffer,
&(SERVER(buffer)->charset_decode_iso),
(argc > 1) ? argv[1] : NULL);
rc = weechat_cmd_charset_set (buffer,
&(SERVER(buffer)->charset_decode_iso),
(argc > 1) ? argv[1] : NULL, 0);
else if (ascii_strcasecmp (argv[0], "decode_utf") == 0)
weechat_cmd_charset_set (buffer,
&(SERVER(buffer)->charset_decode_utf),
(argc > 1) ? argv[1] : NULL);
rc = weechat_cmd_charset_set (buffer,
&(SERVER(buffer)->charset_decode_utf),
(argc > 1) ? argv[1] : NULL, 0);
else if (ascii_strcasecmp (argv[0], "encode") == 0)
weechat_cmd_charset_set (buffer,
&(SERVER(buffer)->charset_encode),
(argc > 1) ? argv[1] : NULL);
rc = weechat_cmd_charset_set (buffer,
&(SERVER(buffer)->charset_encode),
(argc > 1) ? argv[1] : NULL, 1);
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
@@ -1870,6 +1921,8 @@ weechat_cmd_charset (t_irc_server *server, t_irc_channel *channel,
WEECHAT_ERROR, "charset");
return -1;
}
if (rc < 0)
return -1;
}
return 0;
}
@@ -2164,6 +2217,7 @@ weechat_cmd_disconnect (t_irc_server *server, t_irc_channel *channel,
gui_printf (ptr_server->buffer,
_("Auto-reconnection is cancelled\n"));
}
irc_send_quit_server (ptr_server, NULL);
server_disconnect (ptr_server, 0);
gui_status_draw (buffer, 1);
}
@@ -2561,7 +2615,7 @@ weechat_cmd_key (t_irc_server *server, t_irc_channel *channel,
if (gui_keyboard_unbind (arguments))
{
irc_display_prefix (NULL, NULL, PREFIX_INFO);
gui_printf (NULL, _("Key \"%s\" unbinded\n"), arguments);
gui_printf (NULL, _("Key \"%s\" unbound\n"), arguments);
}
else
{
@@ -2639,6 +2693,80 @@ weechat_cmd_key (t_irc_server *server, t_irc_channel *channel,
return 0;
}
/*
* weechat_cmd_panel_display_info: display infos about a panel
*/
void
weechat_cmd_panel_display_info (t_gui_panel *panel)
{
gui_printf (NULL, " %s%2d%s. ",
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
panel->number,
GUI_COLOR(COLOR_WIN_CHAT));
gui_printf (NULL, "%s%s%s ",
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
panel->name,
GUI_COLOR(COLOR_WIN_CHAT));
gui_printf (NULL, "(%s%s/%s",
(panel->panel_window) ? _("global") : _("local"),
GUI_COLOR(COLOR_WIN_CHAT_DARK),
GUI_COLOR(COLOR_WIN_CHAT));
switch (panel->position)
{
case GUI_PANEL_TOP:
gui_printf (NULL, "%s", _("top"));
break;
case GUI_PANEL_BOTTOM:
gui_printf (NULL, "%s", _("bottom"));
break;
case GUI_PANEL_LEFT:
gui_printf (NULL, "%s", _("left"));
break;
case GUI_PANEL_RIGHT:
gui_printf (NULL, "%s", _("right"));
break;
}
gui_printf (NULL, "%s/%s%d)\n",
GUI_COLOR(COLOR_WIN_CHAT_DARK),
GUI_COLOR(COLOR_WIN_CHAT),
panel->size);
}
/*
* weechat_cmd_panel: manage panels
*/
int
weechat_cmd_panel (t_irc_server *server, t_irc_channel *channel,
int argc, char **argv)
{
t_gui_panel *ptr_panel;
/* make gcc happy */
(void) server;
(void) channel;
gui_printf (NULL, "\n/panel command is under development!\n");
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
{
/* list open panels */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Open panels:\n"));
for (ptr_panel = gui_panels; ptr_panel; ptr_panel = ptr_panel->next_panel)
{
weechat_cmd_panel_display_info (ptr_panel);
}
}
else
{
}
return 0;
}
/*
* weechat_cmd_plugin: list/load/unload WeeChat plugins
*/
@@ -2814,21 +2942,18 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
}
/*
* weechat_cmd_save: save options to disk
* weechat_cmd_save: save WeeChat and plugins options to disk
*/
int
weechat_cmd_save (t_irc_server *server, t_irc_channel *channel,
int argc, char **argv)
{
int rc;
/* make gcc happy */
(void) server;
(void) channel;
rc = config_write ((argc == 1) ? argv[0] : NULL);
if (rc == 0)
if (config_write ((argc == 1) ? argv[0] : NULL) == 0)
{
irc_display_prefix (NULL, NULL, PREFIX_INFO);
gui_printf_nolog (NULL, _("Configuration file saved\n"));
@@ -2839,7 +2964,22 @@ weechat_cmd_save (t_irc_server *server, t_irc_channel *channel,
gui_printf_nolog (NULL, _("%s failed to save configuration file\n"),
WEECHAT_ERROR);
}
return rc;
#ifdef PLUGINS
if (plugin_config_write () == 0)
{
irc_display_prefix (NULL, NULL, PREFIX_INFO);
gui_printf_nolog (NULL, _("Plugins options saved\n"));
}
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf_nolog (NULL, _("%s failed to save plugins options\n"),
WEECHAT_ERROR);
}
#endif
return 0;
}
/*
@@ -3345,7 +3485,6 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
{
if (config_option_set_value (ptr_option, value) == 0)
{
(void) (ptr_option->handler_change());
gui_printf (NULL, "\n");
gui_printf (NULL, "%s[%s%s%s]\n",
GUI_COLOR(COLOR_WIN_CHAT_DARK),
@@ -3353,6 +3492,7 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
config_get_section (ptr_option),
GUI_COLOR(COLOR_WIN_CHAT_DARK));
weechat_cmd_set_display_option (ptr_option, NULL, NULL);
(void) (ptr_option->handler_change());
}
else
{
@@ -3869,7 +4009,8 @@ weechat_cmd_upgrade (t_irc_server *server, t_irc_channel *channel,
#ifdef PLUGINS
plugin_end ();
#endif
(void) config_write (NULL);
if (cfg_look_save_on_exit)
(void) config_write (NULL);
gui_main_end ();
fifo_remove ();
weechat_log_close ();
@@ -3976,10 +4117,10 @@ weechat_cmd_window (t_irc_server *server, t_irc_channel *channel,
if ((argc == 0) || ((argc == 1) && (ascii_strcasecmp (argv[0], "list") == 0)))
{
/* list opened windows */
/* list open windows */
gui_printf (NULL, "\n");
gui_printf (NULL, _("Opened windows:\n"));
gui_printf (NULL, _("Open windows:\n"));
i = 1;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
+3 -2
View File
@@ -38,8 +38,8 @@ 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 charset_conversion; /* = 1 if cmd args are converted before */
/* they're executed */
int conversion; /* = 1 if cmd args are converted (charset */
/* and color) before execution */
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 *, t_irc_channel *, char *);
@@ -89,6 +89,7 @@ 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_irc_server *, t_irc_channel *, int, char **);
extern int weechat_cmd_key (t_irc_server *, t_irc_channel *, char *);
extern int weechat_cmd_panel (t_irc_server *, t_irc_channel *, int, 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 **);
+60 -2
View File
@@ -30,7 +30,9 @@
#include "weechat.h"
#include "completion.h"
#include "command.h"
#include "log.h"
#include "utf8.h"
#include "util.h"
#include "weelist.h"
#include "weeconfig.h"
#include "../irc/irc.h"
@@ -53,13 +55,19 @@ completion_init (t_completion *completion, void *server, void *channel)
completion->base_command = NULL;
completion->base_command_arg = 0;
completion->arg_is_nick = 0;
completion->position = -1;
completion->base_word = NULL;
completion->base_word_pos = 0;
completion->position = -1;
completion->args = NULL;
completion->direction = 0;
completion->completion_list = NULL;
completion->last_completion = NULL;
completion->word_found = NULL;
completion->position_replace = 0;
completion->diff_size = 0;
completion->diff_length = 0;
}
/*
@@ -340,6 +348,19 @@ completion_list_add_key_cmd (t_completion *completion)
}
}
/*
* completion_list_add_self_nick: add self nick on server to completion list
*/
void
completion_list_add_self_nick (t_completion *completion)
{
if (completion->server)
{
completion_list_add (completion, ((t_irc_server *)(completion->server))->nick);
}
}
/*
* completion_list_add_channel_nicks: add channel nicks to completion list
*/
@@ -747,6 +768,9 @@ completion_build_list_template (t_completion *completion, char *template)
case 'k': /* key cmd/funtcions*/
completion_list_add_key_cmd (completion);
break;
case 'm': /* self nickname */
completion_list_add_self_nick (completion);
break;
case 'n': /* channel nicks */
completion_list_add_channel_nicks (completion);
break;
@@ -812,7 +836,8 @@ completion_build_list (t_completion *completion)
int max_arg, i;
completion_get_command_infos (completion, &template, &max_arg);
if (!template || (completion->base_command_arg > max_arg))
if (!template || (strcmp (template, "-") == 0) ||
(completion->base_command_arg > max_arg))
{
completion_stop (completion);
return;
@@ -1350,3 +1375,36 @@ completion_search (t_completion *completion, int direction,
}
}
}
/*
* completion_print_log: print completion list in log (usually for crash dump)
*/
void
completion_print_log (t_completion *completion)
{
weechat_log_printf ("[completion (addr:0x%X)]\n", completion);
weechat_log_printf (" server . . . . . . . . : 0x%X\n", completion->server);
weechat_log_printf (" channel. . . . . . . . : 0x%X\n", completion->channel);
weechat_log_printf (" context. . . . . . . . : %d\n", completion->context);
weechat_log_printf (" base_command . . . . . : '%s'\n", completion->base_command);
weechat_log_printf (" base_command_arg . . . : %d\n", completion->base_command_arg);
weechat_log_printf (" arg_is_nick. . . . . . : %d\n", completion->arg_is_nick);
weechat_log_printf (" base_word. . . . . . . : '%s'\n", completion->base_word);
weechat_log_printf (" base_word_pos. . . . . : %d\n", completion->base_word_pos);
weechat_log_printf (" position . . . . . . . : %d\n", completion->position);
weechat_log_printf (" args . . . . . . . . . : '%s'\n", completion->args);
weechat_log_printf (" direction. . . . . . . : %d\n", completion->direction);
weechat_log_printf (" completion_list. . . . : 0x%X\n", completion->completion_list);
weechat_log_printf (" last_completion. . . . : 0x%X\n", completion->last_completion);
weechat_log_printf (" word_found . . . . . . : '%s'\n", completion->word_found);
weechat_log_printf (" position_replace . . . : %d\n", completion->position_replace);
weechat_log_printf (" diff_size. . . . . . . : %d\n", completion->diff_size);
weechat_log_printf (" diff_length. . . . . . : %d\n", completion->diff_length);
if (completion->completion_list)
{
weechat_log_printf ("\n");
weelist_print_log (completion->completion_list,
"completion list element");
}
}
+1
View File
@@ -59,5 +59,6 @@ struct t_completion
extern void completion_init (t_completion *, void *, void *);
extern void completion_free (t_completion *);
extern void completion_search (t_completion *, int, char *, int, int);
extern void completion_print_log (t_completion *);
#endif /* completion.h */
+1
View File
@@ -29,6 +29,7 @@
#include "weechat.h"
#include "history.h"
#include "util.h"
#include "weeconfig.h"
#include "../gui/gui.h"
+22 -2
View File
@@ -176,6 +176,7 @@ session_save_channel (FILE *file, t_irc_channel *channel)
rc = rc && (session_write_str (file, SESSION_CHAN_AWAY_MESSAGE, channel->away_message));
rc = rc && (session_write_int (file, SESSION_CHAN_CYCLE, channel->cycle));
rc = rc && (session_write_int (file, SESSION_CHAN_CLOSE, channel->close));
rc = rc && (session_write_int (file, SESSION_CHAN_DISPLAY_CREATION_DATE, channel->display_creation_date));
rc = rc && (session_write_id (file, SESSION_CHAN_END));
if (!rc)
@@ -258,6 +259,7 @@ session_save_servers (FILE *file)
rc = rc && (session_write_buf (file, SESSION_SERV_RECONNECT_START, &(ptr_server->reconnect_start), sizeof (time_t)));
rc = rc && (session_write_int (file, SESSION_SERV_RECONNECT_JOIN, ptr_server->reconnect_join));
rc = rc && (session_write_int (file, SESSION_SERV_IS_AWAY, ptr_server->is_away));
rc = rc && (session_write_str (file, SESSION_SERV_AWAY_MESSAGE, ptr_server->away_message));
rc = rc && (session_write_buf (file, SESSION_SERV_AWAY_TIME, &(ptr_server->away_time), sizeof (time_t)));
rc = rc && (session_write_int (file, SESSION_SERV_LAG, ptr_server->lag));
rc = rc && (session_write_buf (file, SESSION_SERV_LAG_CHECK_TIME, &(ptr_server->lag_check_time), sizeof (struct timeval)));
@@ -292,8 +294,8 @@ session_save_dcc (FILE *file)
rc = 1;
for (ptr_dcc = dcc_list; ptr_dcc;
ptr_dcc = ptr_dcc->next_dcc)
for (ptr_dcc = last_dcc; ptr_dcc;
ptr_dcc = ptr_dcc->prev_dcc)
{
rc = rc && (session_write_id (file, SESSION_OBJ_DCC));
rc = rc && (session_write_str (file, SESSION_DCC_SERVER, (ptr_dcc->server) ? ptr_dcc->server->name : NULL));
@@ -320,6 +322,9 @@ session_save_dcc (FILE *file)
rc = rc && (session_write_buf (file, SESSION_DCC_LAST_ACTIVITY, &(ptr_dcc->last_activity), sizeof (time_t)));
rc = rc && (session_write_buf (file, SESSION_DCC_BYTES_PER_SEC, &(ptr_dcc->bytes_per_sec), sizeof (unsigned long)));
rc = rc && (session_write_buf (file, SESSION_DCC_ETA, &(ptr_dcc->eta), sizeof (unsigned long)));
rc = rc && (session_write_int (file, SESSION_DCC_CHILD_PID, ptr_dcc->child_pid));
rc = rc && (session_write_int (file, SESSION_DCC_CHILD_READ, ptr_dcc->child_read));
rc = rc && (session_write_int (file, SESSION_DCC_CHILD_WRITE, ptr_dcc->child_write));
rc = rc && (session_write_id (file, SESSION_DCC_END));
if (!rc)
@@ -945,6 +950,9 @@ session_load_server (FILE *file)
case SESSION_SERV_IS_AWAY:
rc = rc && (session_read_int (file, &(session_current_server->is_away)));
break;
case SESSION_SERV_AWAY_MESSAGE:
rc = rc && (session_read_str (file, &(session_current_server->away_message)));
break;
case SESSION_SERV_AWAY_TIME:
rc = rc && (session_read_buf (file, &(session_current_server->away_time), sizeof (time_t)));
break;
@@ -1065,6 +1073,9 @@ session_load_channel (FILE *file)
case SESSION_CHAN_CLOSE:
rc = rc && (session_read_int (file, &(session_current_channel->close)));
break;
case SESSION_CHAN_DISPLAY_CREATION_DATE:
rc = rc && (session_read_int (file, &(session_current_channel->display_creation_date)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"channel (object id: %d)\n"));
@@ -1289,6 +1300,15 @@ session_load_dcc (FILE *file)
case SESSION_DCC_ETA:
rc = rc && (session_read_buf (file, &(dcc->eta), sizeof (unsigned long)));
break;
case SESSION_DCC_CHILD_PID:
rc = rc && (session_read_int (file, &(dcc->child_pid)));
break;
case SESSION_DCC_CHILD_READ:
rc = rc && (session_read_int (file, &(dcc->child_read)));
break;
case SESSION_DCC_CHILD_WRITE:
rc = rc && (session_read_int (file, &(dcc->child_write)));
break;
default:
weechat_log_printf (_("session: warning: ignoring value from "
"DCC (object id: %d)\n"));
+8 -3
View File
@@ -90,7 +90,8 @@ enum t_session_server
SESSION_SERV_CHARSET_DECODE_UTF,
SESSION_SERV_CHARSET_ENCODE,
SESSION_SERV_HOSTNAME,
SESSION_SERV_NICK_MODES
SESSION_SERV_NICK_MODES,
SESSION_SERV_AWAY_MESSAGE
};
enum t_session_channel
@@ -106,7 +107,8 @@ enum t_session_channel
SESSION_CHAN_CHECKING_AWAY,
SESSION_CHAN_AWAY_MESSAGE,
SESSION_CHAN_CYCLE,
SESSION_CHAN_CLOSE
SESSION_CHAN_CLOSE,
SESSION_CHAN_DISPLAY_CREATION_DATE
};
enum t_session_nick
@@ -144,7 +146,10 @@ enum t_session_dcc
SESSION_DCC_LAST_CHECK_POS,
SESSION_DCC_LAST_ACTIVITY,
SESSION_DCC_BYTES_PER_SEC,
SESSION_DCC_ETA
SESSION_DCC_ETA,
SESSION_DCC_CHILD_PID,
SESSION_DCC_CHILD_READ,
SESSION_DCC_CHILD_WRITE
};
enum t_session_history
+322
View File
@@ -0,0 +1,322 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* util.c: some useful functions for WeeChat */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
#include "weechat.h"
#include "weeconfig.h"
/*
* ascii_tolower: locale independant string conversion to lower case
*/
void
ascii_tolower (char *string)
{
while (string && string[0])
{
if ((string[0] >= 'A') && (string[0] <= 'Z'))
string[0] += ('a' - 'A');
string++;
}
}
/*
* ascii_toupper: locale independant string conversion to upper case
*/
void
ascii_toupper (char *string)
{
while (string && string[0])
{
if ((string[0] >= 'a') && (string[0] <= 'z'))
string[0] -= ('a' - 'A');
string++;
}
}
/*
* ascii_strcasecmp: locale and case independent string comparison
*/
int
ascii_strcasecmp (char *string1, char *string2)
{
int c1, c2;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
while (string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
}
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* ascii_strncasecmp: locale and case independent string comparison
* with max length
*/
int
ascii_strncasecmp (char *string1, char *string2, int max)
{
int c1, c2, count;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
count = 0;
while ((count < max) && string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
count++;
}
if (count >= max)
return 0;
else
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* ascii_strcasestr: locale and case independent string search
*/
char *
ascii_strcasestr (char *string, char *search)
{
int length_search;
length_search = strlen (search);
if (!string || !search || (length_search == 0))
return NULL;
while (string[0])
{
if (ascii_strncasecmp (string, search, length_search) == 0)
return string;
string++;
}
return NULL;
}
/*
* weechat_iconv: convert string to another charset
*/
char *
weechat_iconv (char *from_code, char *to_code, char *string)
{
char *outbuf;
#ifdef HAVE_ICONV
iconv_t cd;
char *inbuf;
ICONV_CONST char *ptr_inbuf;
char *ptr_outbuf;
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (ascii_strcasecmp(from_code, to_code) != 0))
{
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))
outbuf = strdup (string);
else
{
inbuf = strdup (string);
ptr_inbuf = inbuf;
inbytesleft = strlen (inbuf);
outbytesleft = inbytesleft * 4;
outbuf = (char *) malloc (outbytesleft + 2);
ptr_outbuf = outbuf;
iconv (cd, &ptr_inbuf, &inbytesleft, &ptr_outbuf, &outbytesleft);
if (inbytesleft != 0)
{
free (outbuf);
outbuf = strdup (string);
}
else
ptr_outbuf[0] = '\0';
free (inbuf);
iconv_close (cd);
}
}
else
outbuf = strdup (string);
#else
/* make gcc happy */
(void) from_code;
(void) to_code;
outbuf = strdup (string);
#endif /* HAVE_ICONV */
return outbuf;
}
/*
* weechat_iconv_check: check a charset
* if a charset is NULL, internal charset is used
*/
int
weechat_iconv_check (char *from_code, char *to_code)
{
#ifdef HAVE_ICONV
iconv_t cd;
if (!from_code || !from_code[0])
from_code = (cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset;
if (!to_code || !to_code[0])
to_code = (cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
cfg_look_charset_internal : local_charset;
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))
return 0;
iconv_close (cd);
return 1;
#else
return 1;
#endif
}
/*
* 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)
*/
long
get_timeval_diff (struct timeval *tv1, struct timeval *tv2)
{
long diff_sec, diff_usec;
diff_sec = tv2->tv_sec - tv1->tv_sec;
diff_usec = tv2->tv_usec - tv1->tv_usec;
if (diff_usec < 0)
{
diff_usec += 1000000;
diff_sec--;
}
return ((diff_usec / 1000) + (diff_sec * 1000));
}
+34
View File
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __WEECHAT_UTIL_H
#define __WEECHAT_UTIL_H 1
extern void ascii_tolower (char *);
extern void ascii_toupper (char *);
extern int ascii_strcasecmp (char *, char *);
extern int ascii_strncasecmp (char *, char *, int);
extern char *ascii_strcasestr (char *, char *);
extern char *weechat_iconv (char *, char *, char *);
extern int weechat_iconv_check (char *, char *);
extern char *weechat_strreplace (char *, char *, char *);
extern long get_timeval_diff (struct timeval *, struct timeval *);
#endif /* util.h */
+19 -246
View File
@@ -51,10 +51,6 @@
#include <gnutls/gnutls.h>
#endif
#ifdef HAVE_ICONV
#include <iconv.h>
#endif
#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
@@ -66,6 +62,7 @@
#include "log.h"
#include "session.h"
#include "utf8.h"
#include "util.h"
#include "weeconfig.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@@ -93,238 +90,6 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */
#endif
/*
* ascii_tolower: locale independant string conversion to lower case
*/
void
ascii_tolower (char *string)
{
while (string && string[0])
{
if ((string[0] >= 'A') && (string[0] <= 'Z'))
string[0] += ('a' - 'A');
string++;
}
}
/*
* ascii_toupper: locale independant string conversion to upper case
*/
void
ascii_toupper (char *string)
{
while (string && string[0])
{
if ((string[0] >= 'a') && (string[0] <= 'z'))
string[0] -= ('a' - 'A');
string++;
}
}
/*
* ascii_strcasecmp: locale and case independent string comparison
*/
int
ascii_strcasecmp (char *string1, char *string2)
{
int c1, c2;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
while (string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
}
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* ascii_strncasecmp: locale and case independent string comparison
* with max length
*/
int
ascii_strncasecmp (char *string1, char *string2, int max)
{
int c1, c2, count;
if (!string1 || !string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
count = 0;
while ((count < max) && string1[0] && string2[0])
{
c1 = (int)((unsigned char) string1[0]);
c2 = (int)((unsigned char) string2[0]);
if ((c1 >= 'A') && (c1 <= 'Z'))
c1 += ('a' - 'A');
if ((c2 >= 'A') && (c2 <= 'Z'))
c2 += ('a' - 'A');
if ((c1 - c2) != 0)
return c1 - c2;
string1++;
string2++;
count++;
}
if (count >= max)
return 0;
else
return (string1[0]) ? 1 : ((string2[0]) ? -1 : 0);
}
/*
* weechat_iconv: convert string to another charset
*/
char *
weechat_iconv (char *from_code, char *to_code, char *string)
{
char *outbuf;
#ifdef HAVE_ICONV
iconv_t cd;
char *inbuf;
ICONV_CONST char *ptr_inbuf;
char *ptr_outbuf;
size_t inbytesleft, outbytesleft;
if (from_code && from_code[0] && to_code && to_code[0]
&& (ascii_strcasecmp(from_code, to_code) != 0))
{
cd = iconv_open (to_code, from_code);
if (cd == (iconv_t)(-1))
outbuf = strdup (string);
else
{
inbuf = strdup (string);
ptr_inbuf = inbuf;
inbytesleft = strlen (inbuf);
outbytesleft = inbytesleft * 4;
outbuf = (char *) malloc (outbytesleft + 2);
ptr_outbuf = outbuf;
iconv (cd, &ptr_inbuf, &inbytesleft, &ptr_outbuf, &outbytesleft);
if (inbytesleft != 0)
{
free (outbuf);
outbuf = strdup (string);
}
else
ptr_outbuf[0] = '\0';
free (inbuf);
iconv_close (cd);
}
}
else
outbuf = strdup (string);
#else
/* make gcc happy */
(void) from_code;
(void) to_code;
outbuf = strdup (string);
#endif /* HAVE_ICONV */
return outbuf;
}
/*
* 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)
*/
long
get_timeval_diff (struct timeval *tv1, struct timeval *tv2)
{
long diff_sec, diff_usec;
diff_sec = tv2->tv_sec - tv1->tv_sec;
diff_usec = tv2->tv_usec - tv1->tv_usec;
if (diff_usec < 0)
{
diff_usec += 1000000;
diff_sec--;
}
return ((diff_usec / 1000) + (diff_sec * 1000));
}
/*
* weechat_display_usage: display WeeChat usage
*/
@@ -693,6 +458,7 @@ weechat_create_home_dirs ()
{
char *ptr_home;
int dir_length;
struct stat statinfo;
if (!weechat_home)
{
@@ -715,6 +481,17 @@ weechat_create_home_dirs ()
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
DIR_SEPARATOR);
}
/* if home already exists, it has to be a directory */
if (stat (weechat_home, &statinfo) == 0)
{
if (!S_ISDIR (statinfo.st_mode))
{
fprintf (stderr, _("%s home (%s) is not a directory\n"),
WEECHAT_ERROR, weechat_home);
weechat_shutdown (EXIT_FAILURE, 0);
}
}
/* create home directory; error is fatal */
if (!weechat_create_dir (weechat_home))
@@ -900,7 +677,6 @@ weechat_dump (int crash)
t_irc_server *ptr_server;
t_irc_channel *ptr_channel;
t_irc_nick *ptr_nick;
t_irc_dcc *ptr_dcc;
t_gui_window *ptr_window;
t_gui_buffer *ptr_buffer;
@@ -947,11 +723,9 @@ weechat_dump (int crash)
}
}
weechat_log_printf ("\n");
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
dcc_print_log (ptr_dcc);
}
dcc_print_log ();
gui_panel_print_log ();
weechat_log_printf ("\n");
weechat_log_printf ("[windows/buffers]\n");
@@ -978,7 +752,7 @@ weechat_dump (int crash)
weechat_log_printf ("\n");
gui_buffer_print_log (ptr_buffer);
}
weechat_log_printf ("\n");
ignore_print_log ();
@@ -1001,8 +775,6 @@ weechat_sigsegv ()
fprintf (stderr, "\n");
fprintf (stderr, "*** Very bad! WeeChat is crashing (SIGSEGV received)\n");
fprintf (stderr, "*** (%s, compiled on %s %s)\n",
PACKAGE_STRING, __DATE__, __TIME__);
if (!weechat_log_crash_rename ())
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file.\n",
weechat_home);
@@ -1070,7 +842,8 @@ main (int argc, char *argv[])
plugin_end (); /* end plugin interface(s) */
#endif
server_disconnect_all (); /* disconnect from all servers */
(void) config_write (NULL); /* save config file */
if (cfg_look_save_on_exit)
(void) config_write (NULL); /* save config file */
command_index_free (); /* free commands index */
dcc_end (); /* remove all DCC */
server_free_all (); /* free all servers */
-7
View File
@@ -104,14 +104,7 @@ extern char *local_charset;
extern gnutls_certificate_credentials gnutls_xcred;
#endif
extern void ascii_tolower (char *);
extern void ascii_toupper (char *);
extern int ascii_strcasecmp (char *, char *);
extern int ascii_strncasecmp (char *, char *, int);
extern char *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);
#endif /* weechat.h */
+32 -5
View File
@@ -41,6 +41,7 @@
#include "fifo.h"
#include "log.h"
#include "utf8.h"
#include "util.h"
#include "../irc/irc.h"
#include "../gui/gui.h"
@@ -64,6 +65,7 @@ t_config_section config_sections[CONFIG_NUMBER_SECTIONS] =
/* config, look & feel section */
int cfg_look_save_on_exit;
int cfg_look_set_title;
int cfg_look_startup_logo;
int cfg_look_startup_version;
@@ -111,7 +113,11 @@ char *cfg_look_read_marker;
char *cfg_look_input_format;
t_config_option weechat_options_look[] =
{ { "look_set_title", N_("set title for window (terminal for Curses GUI) with name and version"),
{ { "look_save_on_exit", N_("save config file on exit"),
N_("save config file on exit"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_save_on_exit, NULL, config_change_save_on_exit },
{ "look_set_title", N_("set title for window (terminal for Curses GUI) with name and version"),
N_("set title for window (terminal for Curses GUI) with name and version"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_look_set_title, NULL, config_change_title },
@@ -796,6 +802,7 @@ int cfg_dcc_auto_accept_files;
int cfg_dcc_auto_accept_chats;
int cfg_dcc_timeout;
int cfg_dcc_blocksize;
int cfg_dcc_fast_send;
char *cfg_dcc_port_range;
char *cfg_dcc_own_ip;
char *cfg_dcc_download_path;
@@ -815,12 +822,16 @@ t_config_option weechat_options_dcc[] =
NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, &config_change_noop },
{ "dcc_timeout", N_("timeout for dcc request"),
N_("timeout for dcc request (in seconds)"),
OPTION_TYPE_INT, 1, INT_MAX, 300,
OPTION_TYPE_INT, 5, INT_MAX, 300,
NULL, NULL, &cfg_dcc_timeout, NULL, &config_change_noop },
{ "dcc_blocksize", N_("block size for dcc packets"),
N_("block size for dcc packets in bytes (default: 65536)"),
OPTION_TYPE_INT, 1024, 102400, 65536,
OPTION_TYPE_INT, DCC_MIN_BLOCKSIZE, DCC_MAX_BLOCKSIZE, 65536,
NULL, NULL, &cfg_dcc_blocksize, NULL, &config_change_noop },
{ "dcc_fast_send", N_("does not wait for ACK when sending file"),
N_("does not wait for ACK when sending file"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
NULL, NULL, &cfg_dcc_fast_send, NULL, &config_change_noop },
{ "dcc_port_range", N_("allowed ports for outgoing dcc"),
N_("restricts outgoing dcc to use only ports in the given range "
"(useful for NAT) (syntax: a single port, ie. 5000 or a port "
@@ -1102,6 +1113,22 @@ config_change_noop ()
/* do nothing */
}
/*
* config_change_save_on_exit: called when "save_on_exit" flag is changed
*/
void
config_change_save_on_exit ()
{
if (!cfg_look_save_on_exit)
{
gui_printf (NULL, "\n");
gui_printf (NULL, _("%s you should now issue /save to write "
"\"save_on_exit\" option in config file.\n"),
WEECHAT_WARNING);
}
}
/*
* config_change_title: called when title is changed
*/
@@ -1366,7 +1393,7 @@ config_option_list_remove (char **string, char *item)
name = (char *) malloc (strlen (item) + 2);
strcpy (name, item);
strcat (name, ":");
pos = strstr (*string, name);
pos = ascii_strcasestr (*string, name);
free (name);
if (pos)
{
@@ -1442,7 +1469,7 @@ config_option_list_get_value (char **string, char *item,
name = (char *) malloc (strlen (item) + 2);
strcpy (name, item);
strcat (name, ":");
pos = strstr (*string, name);
pos = ascii_strcasestr (*string, name);
free (name);
if (pos)
{
+3
View File
@@ -87,6 +87,7 @@ struct t_config_option
void (*handler_change)();
};
extern int cfg_look_save_on_exit;
extern int cfg_look_set_title;
extern int cfg_look_startup_logo;
extern int cfg_look_startup_version;
@@ -220,6 +221,7 @@ extern int cfg_dcc_auto_accept_files;
extern int cfg_dcc_auto_accept_chats;
extern int cfg_dcc_timeout;
extern int cfg_dcc_blocksize;
extern int cfg_dcc_fast_send;
extern char *cfg_dcc_port_range;
extern char *cfg_dcc_own_ip;
extern char *cfg_dcc_download_path;
@@ -246,6 +248,7 @@ extern t_config_option * weechat_options [CONFIG_NUMBER_SECTIONS];
extern char *config_get_section ();
extern void config_change_noop ();
extern void config_change_save_on_exit ();
extern void config_change_title ();
extern void config_change_buffers ();
extern void config_change_buffer_content ();
+21
View File
@@ -29,6 +29,8 @@
#include "weechat.h"
#include "weelist.h"
#include "log.h"
#include "util.h"
/*
@@ -163,3 +165,22 @@ weelist_remove (t_weelist **weelist, t_weelist **last_weelist, t_weelist *elemen
free (element);
*weelist = new_weelist;
}
/*
* weelist_print_log: print weelist in log (usually for crash dump)
*/
void
weelist_print_log (t_weelist *weelist, char *name)
{
t_weelist *ptr_weelist;
for (ptr_weelist = weelist; ptr_weelist;
ptr_weelist = ptr_weelist->next_weelist)
{
weechat_log_printf ("[%s (addr:0x%X)]\n", name, ptr_weelist);
weechat_log_printf (" data . . . . . . . . . : '%s'\n", ptr_weelist->data);
weechat_log_printf (" prev_weelist . . . . . : 0x%X\n", ptr_weelist->prev_weelist);
weechat_log_printf (" next_weelist . . . . . : 0x%X\n", ptr_weelist->next_weelist);
}
}
+4 -3
View File
@@ -30,8 +30,9 @@ struct t_weelist
t_weelist *next_weelist;
};
t_weelist *weelist_search (t_weelist *, char *);
t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
extern t_weelist *weelist_search (t_weelist *, char *);
extern t_weelist *weelist_add (t_weelist **, t_weelist **, char *);
extern void weelist_remove (t_weelist **, t_weelist **, t_weelist *);
extern void weelist_print_log (t_weelist *, char *);
#endif /* weelist.h */
+31 -13
View File
@@ -174,13 +174,13 @@ gui_chat_draw_title (t_gui_buffer *buffer, int erase)
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == buffer)
if ((ptr_win->buffer == buffer) && (buffer->num_displayed > 0))
{
if (erase)
gui_window_curses_clear (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
snprintf (format, 32, "%%-%ds", ptr_win->win_width);
snprintf (format, 32, "%%-%ds", ptr_win->win_title_width);
if (CHANNEL(buffer))
{
if (CHANNEL(buffer)->topic)
@@ -446,7 +446,10 @@ gui_chat_display_word_raw (t_gui_window *window, char *string)
{
saved_char = next_char[0];
next_char[0] = '\0';
wprintw (GUI_CURSES(window)->win_chat, "%s", prev_char);
if ((prev_char[0] == -110) && (!prev_char[1]))
wprintw (GUI_CURSES(window)->win_chat, ".");
else
wprintw (GUI_CURSES(window)->win_chat, "%s", prev_char);
next_char[0] = saved_char;
}
@@ -873,9 +876,10 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
t_irc_dcc *dcc_first, *dcc_selected, *ptr_dcc;
char format_empty[32];
int i, j, line_pos, count, num_bars;
char *unit_name[] = { N_("bytes"), N_("Kb"), N_("Mb"), N_("Gb") };
char *unit_format[] = { "%.0Lf", "%.1Lf", "%.02Lf", "%.02Lf" };
long unit_divide[] = { 1, 1024, 1024*1024, 1024*1024*1024 };
unsigned long pct_complete;
char *unit_name[] = { N_("bytes"), N_("KB"), N_("MB"), N_("GB") };
char *unit_format[] = { "%.0f", "%.1f", "%.02f", "%.02f" };
float unit_divide[] = { 1, 1024, 1024*1024, 1024*1024*1024 };
int num_unit;
char format[32], date[128], *buf;
struct tm *date_tmp;
@@ -885,7 +889,7 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == buffer)
if ((ptr_win->buffer == buffer) && (buffer->num_displayed > 0))
{
if (erase)
{
@@ -953,9 +957,14 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
{
wprintw (GUI_CURSES(ptr_win)->win_chat, " [");
if (ptr_dcc->size == 0)
num_bars = 10;
{
if (ptr_dcc->status == DCC_DONE)
num_bars = 10;
else
num_bars = 0;
}
else
num_bars = (int)((((long double)(ptr_dcc->pos)/(long double)(ptr_dcc->size))*100) / 10);
num_bars = (int)((((float)(ptr_dcc->pos)/(float)(ptr_dcc->size))*100) / 10);
for (j = 0; j < num_bars - 1; j++)
wprintw (GUI_CURSES(ptr_win)->win_chat, "=");
if (num_bars > 0)
@@ -971,15 +980,24 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
num_unit = 2;
else
num_unit = 3;
if (ptr_dcc->size == 0)
{
if (ptr_dcc->status == DCC_DONE)
pct_complete = 100;
else
pct_complete = 0;
}
else
pct_complete = (unsigned long)(((float)(ptr_dcc->pos)/(float)(ptr_dcc->size))*100);
wprintw (GUI_CURSES(ptr_win)->win_chat, "] %3lu%% ",
(unsigned long)(((long double)(ptr_dcc->pos)/(long double)(ptr_dcc->size))*100));
pct_complete);
sprintf (format, "%s %%s / %s %%s",
unit_format[num_unit],
unit_format[num_unit]);
wprintw (GUI_CURSES(ptr_win)->win_chat, format,
((long double)(ptr_dcc->pos)) / ((long double)(unit_divide[num_unit])),
((float)(ptr_dcc->pos)) / ((float)(unit_divide[num_unit])),
unit_name[num_unit],
((long double)(ptr_dcc->size)) / ((long double)(unit_divide[num_unit])),
((float)(ptr_dcc->size)) / ((float)(unit_divide[num_unit])),
unit_name[num_unit]);
if (ptr_dcc->bytes_per_sec < 1024*1024)
@@ -1002,7 +1020,7 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
CHANNEL(buffer),
unit_name[num_unit]);
wprintw (GUI_CURSES(ptr_win)->win_chat, format,
((long double) ptr_dcc->bytes_per_sec) / ((long double)(unit_divide[num_unit])),
((float)ptr_dcc->bytes_per_sec) / ((float)(unit_divide[num_unit])),
buf);
free (buf);
}
+1
View File
@@ -30,6 +30,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/util.h"
#include "../../common/weeconfig.h"
#include "gui-curses.h"
+29 -50
View File
@@ -25,6 +25,7 @@
#endif
#include <stdlib.h>
#include <string.h>
#include "../../common/weechat.h"
#include "../gui.h"
@@ -73,8 +74,8 @@ gui_input_set_color (t_gui_window *window, int irc_color)
int
gui_input_get_prompt_length (t_gui_window *window, char *nick)
{
char *pos, saved_char, *modes;
int char_size, length, mode_found;
char *pos, saved_char;
int char_size, length;
length = 0;
pos = cfg_look_input_format;
@@ -99,18 +100,9 @@ gui_input_get_prompt_length (t_gui_window *window, char *nick)
case 'm':
if (SERVER(window->buffer))
{
mode_found = 0;
for (modes = SERVER(window->buffer)->nick_modes;
modes && modes[0]; modes++)
{
if (modes[0] != ' ')
{
length++;
mode_found = 1;
}
}
if (mode_found)
length++;
if (SERVER(window->buffer)->nick_modes
&& SERVER(window->buffer)->nick_modes[0])
length += strlen (SERVER(window->buffer)->nick_modes);
}
pos++;
break;
@@ -155,8 +147,8 @@ gui_input_get_prompt_length (t_gui_window *window, char *nick)
void
gui_input_draw_prompt (t_gui_window *window, char *nick)
{
char *pos, saved_char, *modes;
int char_size, mode_found;
char *pos, saved_char;
int char_size;
wmove (GUI_CURSES(window)->win_input, 0, 0);
pos = cfg_look_input_format;
@@ -191,25 +183,13 @@ gui_input_draw_prompt (t_gui_window *window, char *nick)
case 'm':
if (SERVER(window->buffer))
{
mode_found = 0;
for (modes = SERVER(window->buffer)->nick_modes;
modes && modes[0]; modes++)
{
if (modes[0] != ' ')
mode_found = 1;
}
if (mode_found)
if (SERVER(window->buffer)->nick_modes
&& SERVER(window->buffer)->nick_modes[0])
{
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT);
wprintw (GUI_CURSES(window)->win_input, "+");
for (modes = SERVER(window->buffer)->nick_modes;
modes && modes[0]; modes++)
{
if (modes[0] != ' ')
wprintw (GUI_CURSES(window)->win_input, "%c",
modes[0]);
}
wprintw (GUI_CURSES(window)->win_input, "%s",
SERVER(window->buffer)->nick_modes);
}
}
pos++;
@@ -349,7 +329,7 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
prompt_length = gui_input_get_prompt_length (ptr_win, ptr_nickname);
if (ptr_win->win_width - prompt_length < 3)
if (ptr_win->win_input_width - prompt_length < 3)
{
prompt_length = 0;
display_prompt = 0;
@@ -358,9 +338,9 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
display_prompt = 1;
if (buffer->input_buffer_pos - buffer->input_buffer_1st_display + 1 >
ptr_win->win_width - prompt_length)
ptr_win->win_input_width - prompt_length)
buffer->input_buffer_1st_display = buffer->input_buffer_pos -
(ptr_win->win_width - prompt_length) + 1;
(ptr_win->win_input_width - prompt_length) + 1;
else
{
if (buffer->input_buffer_pos < buffer->input_buffer_1st_display)
@@ -370,11 +350,11 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
if ((buffer->input_buffer_1st_display > 0) &&
(buffer->input_buffer_pos -
buffer->input_buffer_1st_display + 1)
< ptr_win->win_width - prompt_length)
< ptr_win->win_input_width - prompt_length)
{
buffer->input_buffer_1st_display =
buffer->input_buffer_pos -
(ptr_win->win_width - prompt_length) + 1;
(ptr_win->win_input_width - prompt_length) + 1;
if (buffer->input_buffer_1st_display < 0)
buffer->input_buffer_1st_display = 0;
}
@@ -384,18 +364,18 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
gui_input_draw_prompt (ptr_win, ptr_nickname);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_input, COLOR_WIN_INPUT);
snprintf (format, 32, "%%-%ds", ptr_win->win_width - prompt_length);
snprintf (format, 32, "%%-%ds", ptr_win->win_input_width - prompt_length);
offset_cursor = 0;
if (ptr_win == gui_current_window)
offset_cursor = gui_input_draw_text (ptr_win,
ptr_win->win_width - prompt_length);
ptr_win->win_input_width - prompt_length);
else
wprintw (GUI_CURSES(ptr_win)->win_input, format, "");
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
ptr_win->win_input_x = prompt_length + offset_cursor;
ptr_win->win_input_cursor_x = prompt_length + offset_cursor;
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);
move (ptr_win->win_input_y,
ptr_win->win_input_x + ptr_win->win_input_cursor_x);
}
break;
case BUFFER_TYPE_DCC:
@@ -424,21 +404,20 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [P] Purge old DCC"));
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [Q] Close DCC view"));
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
ptr_win->win_input_x = 0;
ptr_win->win_input_cursor_x = 0;
if (ptr_win == gui_current_window)
move (ptr_win->win_y + ptr_win->win_height - 1,
ptr_win->win_x);
move (ptr_win->win_input_y, ptr_win->win_input_x);
break;
case BUFFER_TYPE_RAW_DATA:
mvwprintw (GUI_CURSES(ptr_win)->win_input, 0, 0, _(" [Q] Close raw data view"));
wmove (GUI_CURSES(ptr_win)->win_input, 0, 0);
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [C] Clear buffer"));
wprintw (GUI_CURSES(ptr_win)->win_input, _(" [Q] Close raw data view"));
wclrtoeol (GUI_CURSES(ptr_win)->win_input);
ptr_win->win_input_x = 0;
ptr_win->win_input_cursor_x = 0;
if (ptr_win == gui_current_window)
move (ptr_win->win_y + ptr_win->win_height - 1,
ptr_win->win_x);
move (ptr_win->win_input_y, ptr_win->win_input_x);
break;
}
doupdate ();
wrefresh (GUI_CURSES(ptr_win)->win_input);
refresh ();
}
+13 -8
View File
@@ -47,7 +47,7 @@ gui_keyboard_default_bindings ()
int i;
char key_str[32], command[32];
/* keys binded with internal functions */
/* keys bound with internal functions */
gui_keyboard_bind ( /* RC */ "ctrl-M", "return");
gui_keyboard_bind ( /* RC */ "ctrl-J", "return");
gui_keyboard_bind ( /* tab */ "ctrl-I", "tab");
@@ -105,7 +105,7 @@ gui_keyboard_default_bindings ()
gui_keyboard_bind ( /* m-s */ "meta-s", "switch_server");
gui_keyboard_bind ( /* m-u */ "meta-u", "scroll_unread");
/* keys binded with commands */
/* keys bound with commands */
gui_keyboard_bind ( /* m-left */ "meta-meta2-D", "/buffer -1");
gui_keyboard_bind ( /* F5 */ "meta2-15~", "/buffer -1");
gui_keyboard_bind ( /* m-right */ "meta-meta2-C", "/buffer +1");
@@ -143,9 +143,12 @@ gui_keyboard_default_bindings ()
void
gui_keyboard_grab_end ()
{
char *expanded_key, *expanded_key2;
int length;
char *expanded_key;
char *buffer_before_key;
#ifdef PLUGINS
char *expanded_key2;
int length;
#endif
/* get expanded name (for example: ^U => ctrl-u) */
expanded_key = gui_keyboard_get_expanded_name (gui_key_buffer);
@@ -193,8 +196,11 @@ void
gui_keyboard_read ()
{
int key, i, insert_ok;
char key_str[32], key_str2[33];
char key_str[32];
char *buffer_before_key;
#ifdef PLUGINS
char key_str2[33];
#endif
i = 0;
/* do not loop too much here (for example when big paste was made),
@@ -214,11 +220,10 @@ gui_keyboard_read ()
break;
}
#ifdef KEY_RESIZE
if (key == KEY_RESIZE)
{
gui_window_refresh_screen ();
continue;
}
#endif
gui_last_activity_time = time (NULL);
+8 -8
View File
@@ -34,6 +34,7 @@
#include "../gui.h"
#include "../../common/fifo.h"
#include "../../common/utf8.h"
#include "../../common/util.h"
#include "../../common/weeconfig.h"
#include "gui-curses.h"
@@ -73,7 +74,7 @@ gui_main_loop ()
{
/* refresh needed ? */
if (gui_refresh_screen_needed)
gui_window_refresh_screen ();
gui_window_refresh_screen (0);
new_time = time (NULL);
local_time = localtime (&new_time);
@@ -112,7 +113,7 @@ gui_main_loop ()
{
gui_infobar_draw_time (gui_current_window->buffer);
wmove (GUI_CURSES(gui_current_window)->win_input,
0, gui_current_window->win_input_x);
0, gui_current_window->win_input_cursor_x);
wrefresh (GUI_CURSES(gui_current_window)->win_input);
}
@@ -291,7 +292,7 @@ gui_main_init ()
gui_infobar = NULL;
gui_ok = ((COLS > 5) && (LINES > 5));
gui_ok = ((COLS > WINDOW_MIN_WIDTH) && (LINES > WINDOW_MIN_HEIGHT));
refresh ();
@@ -328,15 +329,14 @@ gui_main_end ()
while (gui_panels)
gui_panel_free (gui_panels);
/* delete all buffers */
gui_window_merge_all (gui_current_window);
while (gui_buffers)
gui_buffer_free (gui_buffers, 0);
/* delete all windows */
while (gui_windows)
gui_window_free (gui_windows);
gui_window_tree_free (&gui_windows_tree);
/* delete all buffers */
while (gui_buffers)
gui_buffer_free (gui_buffers, 0);
/* delete global history */
history_global_free ();
+2 -2
View File
@@ -36,7 +36,7 @@
*/
void
gui_nicklist_draw (t_gui_buffer *buffer, int erase)
gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
{
t_gui_window *ptr_win;
int i, j, x, y, x2, column, max_length, nicks_displayed;
@@ -52,7 +52,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase)
{
max_length = nick_get_max_length (CHANNEL(buffer));
if (gui_window_calculate_pos_size (ptr_win, 0))
if (calculate_size && (gui_window_calculate_pos_size (ptr_win, 0)))
{
delwin (GUI_CURSES(ptr_win)->win_chat);
delwin (GUI_CURSES(ptr_win)->win_nick);
+19 -4
View File
@@ -33,11 +33,13 @@
/*
* gui_panel_get_size: get total panel size for a position
* gui_panel_windows_get_size: get total panel size (window panels) for a position
* panel is optional, if not NULL, size is computed
* from panel 1 to panel # - 1
*/
int
gui_panel_get_size (t_gui_window *window, int position)
gui_panel_window_get_size (t_gui_panel *panel, t_gui_window *window, int position)
{
t_gui_panel_window *ptr_panel_win;
int total_size;
@@ -46,6 +48,10 @@ gui_panel_get_size (t_gui_window *window, int position)
for (ptr_panel_win = GUI_CURSES(window)->panel_windows; ptr_panel_win;
ptr_panel_win = ptr_panel_win->next_panel_window)
{
/* stop before panel */
if ((panel) && (ptr_panel_win->panel == panel))
return total_size;
if (ptr_panel_win->panel->position == position)
{
switch (position)
@@ -76,6 +82,7 @@ gui_panel_window_new (t_gui_panel *panel, t_gui_window *window)
{
t_gui_panel_window *new_panel_win;
int x1, y1, x2, y2;
int add_top, add_bottom, add_left, add_right;
if (window)
{
@@ -83,6 +90,10 @@ gui_panel_window_new (t_gui_panel *panel, t_gui_window *window)
y1 = window->win_y + 1;
x2 = x1 + window->win_width - 1;
y2 = y1 + window->win_height - 1 - 4;
add_left = gui_panel_window_get_size (panel, window, GUI_PANEL_LEFT);
add_right = gui_panel_window_get_size (panel, window, GUI_PANEL_RIGHT);
add_top = gui_panel_window_get_size (panel, window, GUI_PANEL_TOP);
add_bottom = gui_panel_window_get_size (panel, window, GUI_PANEL_BOTTOM);
}
else
{
@@ -90,6 +101,10 @@ gui_panel_window_new (t_gui_panel *panel, t_gui_window *window)
y1 = 0;
x2 = gui_window_get_width () - 1;
y2 = gui_window_get_height () - 1;
add_left = gui_panel_global_get_size (panel, GUI_PANEL_LEFT);
add_right = gui_panel_global_get_size (panel, GUI_PANEL_RIGHT);
add_top = gui_panel_global_get_size (panel, GUI_PANEL_TOP);
add_bottom = gui_panel_global_get_size (panel, GUI_PANEL_BOTTOM);
}
if ((new_panel_win = (t_gui_panel_window *) malloc (sizeof (t_gui_panel_window))))
@@ -109,8 +124,8 @@ gui_panel_window_new (t_gui_panel *panel, t_gui_window *window)
switch (panel->position)
{
case GUI_PANEL_TOP:
new_panel_win->x = x1;
new_panel_win->y = y1;
new_panel_win->x = x1 + add_left;
new_panel_win->y = y1 + add_top;
new_panel_win->width = x2 - x1 + 1;
new_panel_win->height = panel->size;
break;
+8 -27
View File
@@ -44,7 +44,7 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
t_gui_window *ptr_win;
t_weechat_hotlist *ptr_hotlist;
char format[32], str_nicks[32], *more;
int i, first_mode, x, server_pos, server_total;
int x, server_pos, server_total;
int display_name, names_count;
/* make gcc happy */
@@ -150,8 +150,7 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_CHANNEL);
if (((CHANNEL(ptr_win->buffer)->type != CHANNEL_TYPE_PRIVATE)
&& (CHANNEL(ptr_win->buffer)->type != CHANNEL_TYPE_DCC_CHAT)
if (((CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_CHANNEL)
&& (!CHANNEL(ptr_win->buffer)->nicks))
|| ((CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_DCC_CHAT)
&& (CHANNEL(ptr_win->buffer)->dcc_chat)
@@ -171,28 +170,10 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS);
i = 0;
first_mode = 1;
while (CHANNEL(ptr_win->buffer)->modes[i])
{
if (CHANNEL(ptr_win->buffer)->modes[i] != ' ')
{
if (first_mode)
{
wprintw (GUI_CURSES(ptr_win)->win_status, "+");
first_mode = 0;
}
wprintw (GUI_CURSES(ptr_win)->win_status, "%c",
CHANNEL(ptr_win->buffer)->modes[i]);
}
i++;
}
if (CHANNEL(ptr_win->buffer)->modes[CHANNEL_MODE_KEY] != ' ')
wprintw (GUI_CURSES(ptr_win)->win_status, ",%s",
CHANNEL(ptr_win->buffer)->key);
if (CHANNEL(ptr_win->buffer)->modes[CHANNEL_MODE_LIMIT] != ' ')
wprintw (GUI_CURSES(ptr_win)->win_status, ",%d",
CHANNEL(ptr_win->buffer)->limit);
if (CHANNEL(ptr_win->buffer)->modes
&& (strcmp (CHANNEL(ptr_win->buffer)->modes, "+") != 0))
wprintw (GUI_CURSES(ptr_win)->win_status, "%s",
CHANNEL(ptr_win->buffer)->modes);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ")");
@@ -361,10 +342,10 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
if (BUFFER_HAS_NICKLIST(ptr_win->buffer))
{
snprintf (str_nicks, sizeof (str_nicks) - 1, "%d", CHANNEL(ptr_win->buffer)->nicks_count);
x = ptr_win->win_width - strlen (str_nicks) - 4;
x = ptr_win->win_status_width - strlen (str_nicks) - 4;
}
else
x = ptr_win->win_width - 2;
x = ptr_win->win_status_width - 2;
more = strdup (_("-MORE-"));
x -= strlen (more) - 1;
if (x < 0)
+152 -89
View File
@@ -175,10 +175,10 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
if (!gui_ok)
return 0;
add_left = gui_panel_get_size (window, GUI_PANEL_LEFT);
add_right = gui_panel_get_size (window, GUI_PANEL_RIGHT);
add_top = gui_panel_get_size (window, GUI_PANEL_TOP);
add_bottom = gui_panel_get_size (window, GUI_PANEL_BOTTOM);
add_left = gui_panel_window_get_size (NULL, window, GUI_PANEL_LEFT);
add_right = gui_panel_window_get_size (NULL, window, GUI_PANEL_RIGHT);
add_top = gui_panel_window_get_size (NULL, window, GUI_PANEL_TOP);
add_bottom = gui_panel_window_get_size (NULL, window, GUI_PANEL_BOTTOM);
/* init chat & nicklist settings */
if (cfg_look_nicklist && BUFFER_IS_CHANNEL(window->buffer))
@@ -203,16 +203,17 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
{
nick_count (CHANNEL(window->buffer), &num_nicks, &num_op,
&num_halfop, &num_voice, &num_normal);
if (((max_length + 2) * num_nicks) % window->win_width == 0)
lines = ((max_length + 2) * num_nicks) / window->win_width;
if (((max_length + 2) * num_nicks) % (window->win_width - add_left - add_right) == 0)
lines = ((max_length + 2) * num_nicks) / (window->win_width - add_left - add_right);
else
lines = (((max_length + 2) * num_nicks) / window->win_width) + 1;
lines = (((max_length + 2) * num_nicks) / (window->win_width - add_left - add_right)) + 1;
if ((cfg_look_nicklist_max_size > 0) && (lines > cfg_look_nicklist_max_size))
lines = cfg_look_nicklist_max_size;
if ((cfg_look_nicklist_min_size > 0) && (lines < cfg_look_nicklist_min_size))
lines = cfg_look_nicklist_min_size;
max_height = (cfg_look_infobar) ?
window->win_height - 3 - 4 : window->win_height - 2 - 4;
window->win_height - add_top - add_bottom - 3 - 4 :
window->win_height - add_top - add_bottom - 2 - 4;
if (lines > max_height)
lines = max_height;
if (!force_calculate && (window->win_nick_height == lines + 1))
@@ -223,95 +224,132 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
{
case CFG_LOOK_NICKLIST_LEFT:
window->win_chat_x = window->win_x + add_left + max_length + 2;
window->win_chat_y = window->win_y + 1;
window->win_chat_width = window->win_width - add_left - max_length - 2;
window->win_nick_x = window->win_x + 0;
window->win_nick_y = window->win_y + 1;
window->win_chat_y = window->win_y + add_top + 1;
window->win_chat_width = window->win_width - add_left - add_right - max_length - 2;
window->win_nick_x = window->win_x + add_left + 0;
window->win_nick_y = window->win_y + add_top + 1;
window->win_nick_width = max_length + 2;
if (cfg_look_infobar)
{
window->win_chat_height = window->win_height - 4;
window->win_nick_height = window->win_height - 4;
window->win_chat_height = window->win_height - add_top - add_bottom - 4;
window->win_nick_height = window->win_height - add_top - add_bottom - 4;
}
else
{
window->win_chat_height = window->win_height - 3;
window->win_nick_height = window->win_height - 3;
window->win_chat_height = window->win_height - add_top - add_bottom - 3;
window->win_nick_height = window->win_height - add_top - add_bottom - 3;
}
window->win_nick_num_max = window->win_nick_height;
break;
case CFG_LOOK_NICKLIST_RIGHT:
window->win_chat_x = window->win_x + add_left;
window->win_chat_y = window->win_y + 1;
window->win_chat_width = window->win_width - add_left - max_length - 2;
window->win_nick_x = window->win_x + window->win_width - max_length - 2;
window->win_nick_y = window->win_y + 1;
window->win_chat_y = window->win_y + add_top + 1;
window->win_chat_width = window->win_width - add_left - add_right - max_length - 2;
window->win_nick_x = window->win_x + window->win_width - add_right - max_length - 2;
window->win_nick_y = window->win_y + add_top + 1;
window->win_nick_width = max_length + 2;
if (cfg_look_infobar)
{
window->win_chat_height = window->win_height - 4;
window->win_nick_height = window->win_height - 4;
window->win_chat_height = window->win_height - add_top - add_bottom - 4;
window->win_nick_height = window->win_height - add_top - add_bottom - 4;
}
else
{
window->win_chat_height = window->win_height - 3;
window->win_nick_height = window->win_height - 3;
window->win_chat_height = window->win_height - add_top - add_bottom - 3;
window->win_nick_height = window->win_height - add_top - add_bottom - 3;
}
window->win_nick_num_max = window->win_nick_height;
break;
case CFG_LOOK_NICKLIST_TOP:
window->win_chat_x = window->win_x + add_left;
window->win_chat_y = window->win_y + 1 + (lines + 1);
window->win_chat_width = window->win_width - add_left;
window->win_chat_y = window->win_y + add_top + 1 + (lines + 1);
window->win_chat_width = window->win_width - add_left - add_right;
if (cfg_look_infobar)
window->win_chat_height = window->win_height - 3 - (lines + 1) - 1;
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1) - 1;
else
window->win_chat_height = window->win_height - 3 - (lines + 1);
window->win_nick_x = window->win_x;
window->win_nick_y = window->win_y + 1;
window->win_nick_width = window->win_width;
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1);
window->win_nick_x = window->win_x + add_left;
window->win_nick_y = window->win_y + add_top + 1;
window->win_nick_width = window->win_width - add_left - add_right;
window->win_nick_height = lines + 1;
window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2));
break;
case CFG_LOOK_NICKLIST_BOTTOM:
window->win_chat_x = window->win_x + add_left;
window->win_chat_y = window->win_y + 1;
window->win_chat_width = window->win_width - add_left;
window->win_chat_y = window->win_y + add_top + 1;
window->win_chat_width = window->win_width - add_left - add_right;
if (cfg_look_infobar)
window->win_chat_height = window->win_height - 3 - (lines + 1) - 1;
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1) - 1;
else
window->win_chat_height = window->win_height - 3 - (lines + 1);
window->win_nick_x = window->win_x;
window->win_chat_height = window->win_height - add_top - add_bottom - 3 - (lines + 1);
window->win_nick_x = window->win_x + add_left;
if (cfg_look_infobar)
window->win_nick_y = window->win_y + window->win_height - 2 - (lines + 1) - 1;
window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - (lines + 1) - 1;
else
window->win_nick_y = window->win_y + window->win_height - 2 - (lines + 1);
window->win_nick_width = window->win_width;
window->win_nick_y = window->win_y + window->win_height - add_bottom - 2 - (lines + 1);
window->win_nick_width = window->win_width - add_left - add_right;
window->win_nick_height = lines + 1;
window->win_nick_num_max = lines * (window->win_nick_width / (max_length + 2));
break;
}
window->win_chat_cursor_x = window->win_x;
window->win_chat_cursor_y = window->win_y;
window->win_chat_cursor_x = window->win_x + add_left;
window->win_chat_cursor_y = window->win_y + add_top;
}
else
{
window->win_chat_x = window->win_x + add_left;
window->win_chat_y = window->win_y + 1;
window->win_chat_width = window->win_width - add_left;
window->win_chat_y = window->win_y + add_top + 1;
window->win_chat_width = window->win_width - add_left - add_right;
if (cfg_look_infobar)
window->win_chat_height = window->win_height - 4;
window->win_chat_height = window->win_height - add_top - add_bottom - 4;
else
window->win_chat_height = window->win_height - 3;
window->win_chat_height = window->win_height - add_top - add_bottom - 3;
window->win_chat_cursor_x = window->win_x + add_left;
window->win_chat_cursor_y = window->win_y;
window->win_chat_cursor_y = window->win_y + add_top;
window->win_nick_x = -1;
window->win_nick_y = -1;
window->win_nick_width = -1;
window->win_nick_height = -1;
window->win_nick_num_max = -1;
}
/* title window */
window->win_title_x = window->win_x;
window->win_title_y = window->win_y;
window->win_title_width = window->win_width;
window->win_title_height = 1;
/* status window */
window->win_status_x = window->win_x;
if (cfg_look_infobar)
window->win_status_y = window->win_y + window->win_height - 3;
else
window->win_status_y = window->win_y + window->win_height - 2;
window->win_status_width = window->win_width;
window->win_status_height = 1;
/* infobar window */
if (cfg_look_infobar)
{
window->win_infobar_x = window->win_x;
window->win_infobar_y = window->win_y + window->win_height - 2;
window->win_infobar_width = window->win_width;
window->win_infobar_height = 1;
}
else
{
window->win_infobar_x = -1;
window->win_infobar_y = -1;
window->win_infobar_width = -1;
window->win_infobar_height = -1;
}
/* input window */
window->win_input_x = window->win_x;
window->win_input_y = window->win_y + window->win_height - 1;
window->win_input_width = window->win_width;
window->win_input_height = 1;
return 1;
}
@@ -358,7 +396,7 @@ gui_window_redraw_buffer (t_gui_buffer *buffer)
gui_chat_draw_title (buffer, 1);
gui_chat_draw (buffer, 1);
if (GUI_CURSES(ptr_win)->win_nick)
gui_nicklist_draw (buffer, 1);
gui_nicklist_draw (buffer, 1, 0);
gui_status_draw (buffer, 1);
if (cfg_look_infobar)
gui_infobar_draw (buffer, 1);
@@ -377,7 +415,7 @@ gui_window_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
{
if (!gui_ok)
return;
if (window->buffer->num_displayed > 0)
window->buffer->num_displayed--;
@@ -390,20 +428,21 @@ gui_window_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
window->buffer = buffer;
window->win_nick_start = 0;
gui_window_calculate_pos_size (window, 1);
/* destroy Curses windows */
gui_window_objects_free (window, 0);
/* create Curses windows */
GUI_CURSES(window)->win_title = newwin (1,
window->win_width,
window->win_y,
window->win_x);
GUI_CURSES(window)->win_input = newwin (1,
window->win_width,
window->win_y + window->win_height - 1,
window->win_x);
GUI_CURSES(window)->win_title = newwin (window->win_title_height,
window->win_title_width,
window->win_title_y,
window->win_title_x);
GUI_CURSES(window)->win_input = newwin (window->win_input_height,
window->win_input_width,
window->win_input_y,
window->win_input_x);
if (BUFFER_IS_CHANNEL(buffer))
{
if (GUI_CURSES(window)->win_chat)
@@ -432,22 +471,19 @@ gui_window_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
/* create status/infobar windows */
if (cfg_look_infobar)
{
GUI_CURSES(window)->win_infobar = newwin (1, window->win_width,
window->win_y + window->win_height - 2,
window->win_x);
GUI_CURSES(window)->win_status = newwin (1, window->win_width,
window->win_y + window->win_height - 3,
window->win_x);
}
else
GUI_CURSES(window)->win_status = newwin (1, window->win_width,
window->win_y + window->win_height - 2,
window->win_x);
GUI_CURSES(window)->win_infobar = newwin (window->win_infobar_height,
window->win_infobar_width,
window->win_infobar_y,
window->win_infobar_x);
GUI_CURSES(window)->win_status = newwin (window->win_status_height,
window->win_status_width,
window->win_status_y,
window->win_status_x);
window->start_line = NULL;
window->start_line_pos = 0;
buffer->num_displayed++;
hotlist_remove_buffer (buffer);
@@ -623,7 +659,7 @@ gui_window_nick_beginning (t_gui_window *window)
if (window->win_nick_start > 0)
{
window->win_nick_start = 0;
gui_nicklist_draw (window->buffer, 1);
gui_nicklist_draw (window->buffer, 1, 0);
}
}
}
@@ -652,7 +688,7 @@ gui_window_nick_end (t_gui_window *window)
if (new_start != window->win_nick_start)
{
window->win_nick_start = new_start;
gui_nicklist_draw (window->buffer, 1);
gui_nicklist_draw (window->buffer, 1, 0);
}
}
}
@@ -674,7 +710,7 @@ gui_window_nick_page_up (t_gui_window *window)
window->win_nick_start -= (window->win_nick_num_max - 1);
if (window->win_nick_start <= 1)
window->win_nick_start = 0;
gui_nicklist_draw (window->buffer, 1);
gui_nicklist_draw (window->buffer, 1, 0);
}
}
}
@@ -699,7 +735,7 @@ gui_window_nick_page_down (t_gui_window *window)
window->win_nick_start += (window->win_nick_num_max - 1);
else
window->win_nick_start += (window->win_nick_num_max - 2);
gui_nicklist_draw (window->buffer, 1);
gui_nicklist_draw (window->buffer, 1, 0);
}
}
}
@@ -778,17 +814,19 @@ gui_window_refresh_windows ()
gui_window_get_width (),
gui_window_get_height (), 0) < 0)
gui_window_merge_all (gui_current_window);
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
gui_window_switch_to_buffer (ptr_win, ptr_win->buffer);
}
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
gui_window_redraw_buffer (ptr_win->buffer);
gui_window_draw_separator (ptr_win);
}
gui_current_window = old_current_window;
gui_window_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_window_redraw_buffer (gui_current_window->buffer);
}
}
@@ -1133,24 +1171,32 @@ gui_window_switch_right (t_gui_window *window)
/*
* gui_window_refresh_screen: called when term size is modified
* force == 1 when Ctrl+L is pressed
*/
void
gui_window_refresh_screen ()
gui_window_refresh_screen (int force)
{
int new_height, new_width;
endwin ();
refresh ();
getmaxyx (stdscr, new_height, new_width);
gui_ok = ((new_width > WINDOW_MIN_WIDTH) && (new_height > WINDOW_MIN_HEIGHT));
if (gui_ok)
gui_window_refresh_windows ();
gui_refresh_screen_needed = 0;
if (force || (gui_refresh_screen_needed == 1))
{
endwin ();
refresh ();
getmaxyx (stdscr, new_height, new_width);
gui_ok = ((new_width > WINDOW_MIN_WIDTH) && (new_height > WINDOW_MIN_HEIGHT));
if (gui_ok)
{
refresh ();
gui_window_refresh_windows ();
}
}
if (!force && (gui_refresh_screen_needed > 0))
gui_refresh_screen_needed--;
}
/*
@@ -1160,7 +1206,8 @@ gui_window_refresh_screen ()
void
gui_window_refresh_screen_sigwinch ()
{
gui_refresh_screen_needed = 1;
if (gui_refresh_screen_needed < 2)
gui_refresh_screen_needed++;
signal (SIGWINCH, gui_window_refresh_screen_sigwinch);
}
@@ -1253,6 +1300,8 @@ gui_window_reset_title ()
void
gui_window_objects_print_log (t_gui_window *window)
{
t_gui_panel_window *ptr_panel_win;
weechat_log_printf (" win_title . . . . . : 0x%X\n", GUI_CURSES(window)->win_title);
weechat_log_printf (" win_chat. . . . . . : 0x%X\n", GUI_CURSES(window)->win_chat);
weechat_log_printf (" win_nick. . . . . . : 0x%X\n", GUI_CURSES(window)->win_nick);
@@ -1260,4 +1309,18 @@ gui_window_objects_print_log (t_gui_window *window)
weechat_log_printf (" win_infobar . . . . : 0x%X\n", GUI_CURSES(window)->win_infobar);
weechat_log_printf (" win_input . . . . . : 0x%X\n", GUI_CURSES(window)->win_input);
weechat_log_printf (" win_separator . . . : 0x%X\n", GUI_CURSES(window)->win_separator);
for (ptr_panel_win = GUI_CURSES(window)->panel_windows;
ptr_panel_win; ptr_panel_win = ptr_panel_win->next_panel_window)
{
weechat_log_printf ("\n");
weechat_log_printf (" [window panel (addr:0x%X)]\n", ptr_panel_win);
weechat_log_printf (" panel . . . . . . : 0x%X\n", ptr_panel_win->panel);
weechat_log_printf (" x . . . . . . . . : %d\n", ptr_panel_win->x);
weechat_log_printf (" y . . . . . . . . : %d\n", ptr_panel_win->y);
weechat_log_printf (" width . . . . . . : %d\n", ptr_panel_win->width);
weechat_log_printf (" height. . . . . . : %d\n", ptr_panel_win->height);
weechat_log_printf (" win_panel . . . . : 0x%X\n", ptr_panel_win->win_panel);
weechat_log_printf (" win_separator . . : 0x%X\n", ptr_panel_win->win_separator);
weechat_log_printf (" next_panel_window : 0x%X\n", ptr_panel_win->next_panel_window);
}
}
+7 -2
View File
@@ -23,8 +23,10 @@
#ifdef HAVE_NCURSESW_CURSES_H
#include <ncursesw/ncurses.h>
#else
#elif HAVE_NCURSES_H
#include <ncurses.h>
#else
#include <curses.h>
#endif
/* shift ncurses colors for compatibility with colors
@@ -39,6 +41,9 @@
#define WEECHAT_COLOR_CYAN COLOR_YELLOW
#define WEECHAT_COLOR_WHITE COLOR_WHITE
#define WINDOW_MIN_WIDTH 10
#define WINDOW_MIN_HEIGHT 5
#define GUI_CURSES(window) ((t_gui_curses_objects *)(window->gui_objects))
typedef struct t_gui_panel_window t_gui_panel_window;
@@ -92,7 +97,7 @@ extern void gui_window_set_title ();
extern void gui_window_reset_title ();
/* panel functions */
extern int gui_panel_get_size (t_gui_window *, int);
extern int gui_panel_window_get_size (t_gui_panel *, t_gui_window *, int);
extern void gui_panel_redraw_buffer (t_gui_buffer *);
#endif /* gui-curses.h */
+1
View File
@@ -30,6 +30,7 @@
#include "../../common/weechat.h"
#include "../gui.h"
#include "../../common/util.h"
#include "../../common/weeconfig.h"
#include "gui-gtk.h"
+2 -1
View File
@@ -36,7 +36,7 @@
*/
void
gui_nicklist_draw (t_gui_buffer *buffer, int erase)
gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
{
/*t_gui_window *ptr_win;
int i, j, x, y, column, max_length, nicks_displayed;
@@ -49,4 +49,5 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase)
/* TODO: write this function for Gtk */
(void) buffer;
(void) erase;
(void) calculate_size;
}
+6 -10
View File
@@ -386,7 +386,7 @@ gui_window_nick_beginning (t_gui_window *window)
if (window->win_nick_start > 0)
{
window->win_nick_start = 0;
gui_nicklist_draw (window->buffer, 1);
gui_nicklist_draw (window->buffer, 1, 0);
}
}
}
@@ -415,7 +415,7 @@ gui_window_nick_end (t_gui_window *window)
if (new_start != window->win_nick_start)
{
window->win_nick_start = new_start;
gui_nicklist_draw (window->buffer, 1);
gui_nicklist_draw (window->buffer, 1, 0);
}
}
}
@@ -437,7 +437,7 @@ gui_window_nick_page_up (t_gui_window *window)
window->win_nick_start -= (window->win_nick_height - 1);
if (window->win_nick_start <= 1)
window->win_nick_start = 0;
gui_nicklist_draw (window->buffer, 1);
gui_nicklist_draw (window->buffer, 1, 0);
}
}
}
@@ -462,7 +462,7 @@ gui_window_nick_page_down (t_gui_window *window)
window->win_nick_start += (window->win_nick_height - 1);
else
window->win_nick_start += (window->win_nick_height - 2);
gui_nicklist_draw (window->buffer, 1);
gui_nicklist_draw (window->buffer, 1, 0);
}
}
}
@@ -485,8 +485,6 @@ gui_window_auto_resize (t_gui_window_tree *tree,
{
if (tree->window)
{
if ((width < WINDOW_MIN_WIDTH) || (height < WINDOW_MIN_HEIGHT))
return -1;
if (!simulate)
{
tree->window->win_x = x;
@@ -555,8 +553,7 @@ gui_window_split_horiz (t_gui_window *window, int pourcentage)
height1 = (window->win_height * pourcentage) / 100;
height2 = window->win_height - height1;
if ((height1 >= WINDOW_MIN_HEIGHT) && (height2 >= WINDOW_MIN_HEIGHT)
&& (pourcentage > 0) && (pourcentage <= 100))
if ((pourcentage > 0) && (pourcentage <= 100))
{
if ((new_window = gui_window_new (window,
window->win_x, window->win_y,
@@ -597,8 +594,7 @@ gui_window_split_vertic (t_gui_window *window, int pourcentage)
width1 = (window->win_width * pourcentage) / 100;
width2 = window->win_width - width1 - 1;
if ((width1 >= WINDOW_MIN_WIDTH) && (width2 >= WINDOW_MIN_WIDTH)
&& (pourcentage > 0) && (pourcentage <= 100))
if ((pourcentage > 0) && (pourcentage <= 100))
{
if ((new_window = gui_window_new (window,
window->win_x + width1 + 1, window->win_y,
+1 -1
View File
@@ -1200,7 +1200,7 @@ gui_action_refresh_screen (t_gui_window *window)
/* make gcc happy */
(void) window;
gui_window_refresh_screen ();
gui_window_refresh_screen (1);
}
/*
+13 -8
View File
@@ -99,6 +99,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
gui_buffers->all_servers = 1;
if (cfg_log_auto_server)
gui_log_start (gui_buffers);
gui_buffers->completion.server = server;
return gui_buffers;
}
@@ -441,10 +442,6 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
if (buffer->type == BUFFER_TYPE_RAW_DATA)
gui_buffer_raw_data = NULL;
/* purge DCC chat using this buffer */
if (CHANNEL(buffer))
dcc_chat_remove_channel (CHANNEL(buffer));
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
@@ -573,7 +570,7 @@ gui_buffer_line_new (t_gui_buffer *buffer)
void
gui_buffer_merge_servers (t_gui_window *window)
{
t_gui_buffer *ptr_buffer_server, *ptr_buffer;
t_gui_buffer *ptr_buffer_server, *ptr_buffer, *new_ptr_buffer;
t_irc_server *ptr_server;
/* new server buffer is the first server buffer found */
@@ -587,9 +584,9 @@ gui_buffer_merge_servers (t_gui_window *window)
/* no server buffer found */
if (!ptr_buffer_server)
return;
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
ptr_buffer = gui_buffers;
while (ptr_buffer)
{
if ((ptr_buffer != ptr_buffer_server)
&& (BUFFER_IS_SERVER(ptr_buffer)))
@@ -617,12 +614,16 @@ gui_buffer_merge_servers (t_gui_window *window)
/* free buffer but not lines, because they're now used by
our unique server buffer */
new_ptr_buffer = ptr_buffer->next_buffer;
ptr_buffer->lines = NULL;
gui_buffer_free (ptr_buffer, 1);
ptr_buffer = new_ptr_buffer;
/* asociate server with new server buffer */
ptr_server->buffer = ptr_buffer_server;
}
else
ptr_buffer = ptr_buffer->next_buffer;
}
ptr_buffer_server->all_servers = 1;
@@ -910,6 +911,7 @@ gui_buffer_print_log (t_gui_buffer *buffer)
weechat_log_printf (" input_buffer_length. . : %d\n", buffer->input_buffer_length);
weechat_log_printf (" input_buffer_pos . . . : %d\n", buffer->input_buffer_pos);
weechat_log_printf (" input_buffer_1st_disp. : %d\n", buffer->input_buffer_1st_display);
weechat_log_printf (" completion . . . . . . : 0x%X\n", &(buffer->completion));
weechat_log_printf (" history. . . . . . . . : 0x%X\n", buffer->history);
weechat_log_printf (" last_history . . . . . : 0x%X\n", buffer->last_history);
weechat_log_printf (" ptr_history. . . . . . : 0x%X\n", buffer->ptr_history);
@@ -939,4 +941,7 @@ gui_buffer_print_log (t_gui_buffer *buffer)
ptr_line = ptr_line->next_line;
}
weechat_log_printf ("\n");
completion_print_log (&(buffer->completion));
}
+27 -5
View File
@@ -380,8 +380,8 @@ gui_printf_raw_data (void *server, int send, char *message)
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((send) ? COLOR_WIN_CHAT_PART : COLOR_WIN_CHAT_JOIN),
(send) ? PREFIX_PART : PREFIX_JOIN,
GUI_COLOR(COLOR_WIN_CHAT),
message);
if (pos)
@@ -671,6 +671,7 @@ void
gui_exec_action_dcc (t_gui_window *window, char *actions)
{
t_irc_dcc *dcc_selected, *ptr_dcc, *ptr_dcc_next;
t_gui_window *ptr_win;
t_gui_buffer *ptr_buffer;
while (actions[0])
@@ -705,7 +706,9 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
/* purge old DCC */
case 'p':
case 'P':
window->dcc_first = NULL;
window->dcc_selected = NULL;
window->dcc_last_displayed = NULL;
ptr_dcc = dcc_list;
while (ptr_dcc)
{
@@ -722,7 +725,13 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
if (gui_buffer_before_dcc)
{
ptr_buffer = window->buffer;
gui_window_switch_to_buffer (window, gui_buffer_before_dcc);
for (ptr_win = gui_windows; ptr_win;
ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == ptr_buffer)
gui_window_switch_to_buffer (ptr_win,
gui_buffer_before_dcc);
}
gui_buffer_free (ptr_buffer, 0);
}
else
@@ -759,6 +768,7 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
void
gui_exec_action_raw_data (t_gui_window *window, char *actions)
{
t_gui_window *ptr_win;
t_gui_buffer *ptr_buffer;
while (actions[0])
@@ -768,13 +778,25 @@ gui_exec_action_raw_data (t_gui_window *window, char *actions)
switch (actions[0])
{
/* close raw IRC data */
case 'c':
case 'C':
gui_buffer_clear (window->buffer);
gui_window_redraw_buffer (window->buffer);
return;
break;
/* close raw IRC data */
case 'q':
case 'Q':
if (gui_buffer_before_raw_data)
{
ptr_buffer = window->buffer;
gui_window_switch_to_buffer (window,
gui_buffer_before_raw_data);
for (ptr_win = gui_windows; ptr_win;
ptr_win = ptr_win->next_window)
{
if (ptr_win->buffer == ptr_buffer)
gui_window_switch_to_buffer (ptr_win,
gui_buffer_before_raw_data);
}
gui_buffer_free (ptr_buffer, 0);
}
else
+1
View File
@@ -32,6 +32,7 @@
#include "gui.h"
#include "../common/command.h"
#include "../common/log.h"
#include "../common/util.h"
#ifdef PLUGINS
#include "../plugins/plugins.h"
+1
View File
@@ -31,6 +31,7 @@
#include "../common/weechat.h"
#include "gui.h"
#include "../common/log.h"
#include "../common/util.h"
#include "../common/weeconfig.h"
+63 -2
View File
@@ -35,18 +35,55 @@
#include "../common/weechat.h"
#include "gui.h"
#include "../common/log.h"
t_gui_panel *gui_panels = NULL; /* pointer to first panel */
t_gui_panel *last_gui_panel = NULL; /* pointer to last panel */
/*
* gui_panel_global_get_size: get total panel size (global panels) for a position
*/
int
gui_panel_global_get_size (t_gui_panel *panel, int position)
{
t_gui_panel *ptr_panel;
int total_size;
total_size = 0;
for (ptr_panel = gui_panels; ptr_panel; ptr_panel = ptr_panel->next_panel)
{
if ((panel) && (ptr_panel == panel))
return total_size;
if (ptr_panel->position == position)
{
switch (position)
{
case GUI_PANEL_TOP:
case GUI_PANEL_BOTTOM:
total_size += ptr_panel->size;
break;
case GUI_PANEL_LEFT:
case GUI_PANEL_RIGHT:
total_size += ptr_panel->size;
break;
}
if (ptr_panel->separator)
total_size++;
}
}
return total_size;
}
/*
* gui_panel_new: create a new panel
*/
t_gui_panel *
gui_panel_new (char *name, int position, int type, int size, int separator)
gui_panel_new (char *name, int type, int position, int size, int separator)
{
t_gui_panel *new_panel;
t_gui_window *ptr_win;
@@ -56,8 +93,9 @@ gui_panel_new (char *name, int position, int type, int size, int separator)
if ((new_panel = (t_gui_panel *) malloc (sizeof (t_gui_panel))))
{
new_panel->position = position;
new_panel->number = (last_gui_panel) ? last_gui_panel->number + 1 : 1;
new_panel->name = strdup (name);
new_panel->position = position;
new_panel->separator = separator;
new_panel->size = size;
if (type == GUI_PANEL_WINDOWS)
@@ -111,3 +149,26 @@ gui_panel_free (t_gui_panel *panel)
free (panel);
}
/*
* gui_panel_print_log: print panel infos in log (usually for crash dump)
*/
void
gui_panel_print_log ()
{
t_gui_panel *ptr_panel;
for (ptr_panel = gui_panels; ptr_panel; ptr_panel = ptr_panel->next_panel)
{
weechat_log_printf ("\n");
weechat_log_printf ("[panel (addr:0x%X)]\n", ptr_panel);
weechat_log_printf (" position. . . . . . : %d\n", ptr_panel->position);
weechat_log_printf (" name. . . . . . . . : '%s'\n", ptr_panel->name);
weechat_log_printf (" panel_window. . . . : 0x%X\n", ptr_panel->panel_window);
weechat_log_printf (" separator . . . . . : %d\n", ptr_panel->separator);
weechat_log_printf (" size. . . . . . . . : %d\n", ptr_panel->size);
weechat_log_printf (" prev_panel . .. . . : 0x%X\n", ptr_panel->prev_panel);
weechat_log_printf (" next_panel . .. . . : 0x%X\n", ptr_panel->next_panel);
}
}
+6 -5
View File
@@ -23,11 +23,11 @@
#define GUI_PANEL_TOP 1
#define GUI_PANEL_BOTTOM 2
#define GUI_PANEL_LEFT 3
#define GUI_PANEL_RIGHT 4
#define GUI_PANEL_LEFT 4
#define GUI_PANEL_RIGHT 8
#define GUI_PANEL_GLOBAL 0
#define GUI_PANEL_WINDOWS 1
#define GUI_PANEL_GLOBAL 1
#define GUI_PANEL_WINDOWS 2
/* panel structure */
@@ -36,8 +36,9 @@ typedef struct t_gui_panel t_gui_panel;
struct t_gui_panel
{
int position; /* position (top, bottom, left, right) */
int number; /* panel number */
char *name; /* panel name */
int position; /* position (top, bottom, left, right) */
void *panel_window; /* pointer to panel window, NULL if */
/* displayed on each window (in this */
/* case, pointers are in windows) */
+18 -2
View File
@@ -213,7 +213,7 @@ gui_window_new (t_gui_window *parent, int x, int y, int width, int height,
new_window->win_nick_num_max = 0;
new_window->win_nick_start = 0;
new_window->win_input_x = 0;
new_window->win_input_cursor_x = 0;
new_window->dcc_first = NULL;
new_window->dcc_selected = NULL;
@@ -409,6 +409,23 @@ gui_window_print_log (t_gui_window *window)
weechat_log_printf (" win_nick_width. . . : %d\n", window->win_nick_width);
weechat_log_printf (" win_nick_height . . : %d\n", window->win_nick_height);
weechat_log_printf (" win_nick_start. . . : %d\n", window->win_nick_start);
weechat_log_printf (" win_title_x . . . . : %d\n", window->win_title_x);
weechat_log_printf (" win_title_y . . . . : %d\n", window->win_title_y);
weechat_log_printf (" win_title_width . . : %d\n", window->win_title_width);
weechat_log_printf (" win_title_height. . : %d\n", window->win_title_height);
weechat_log_printf (" win_status_x. . . . : %d\n", window->win_status_x);
weechat_log_printf (" win_status_y. . . . : %d\n", window->win_status_y);
weechat_log_printf (" win_status_width. . : %d\n", window->win_status_width);
weechat_log_printf (" win_status_height . : %d\n", window->win_status_height);
weechat_log_printf (" win_infobar_x . . . : %d\n", window->win_infobar_x);
weechat_log_printf (" win_infobar_y . . . : %d\n", window->win_infobar_y);
weechat_log_printf (" win_infobar_width . : %d\n", window->win_infobar_width);
weechat_log_printf (" win_infobar_height. : %d\n", window->win_infobar_height);
weechat_log_printf (" win_input_x . . . . : %d\n", window->win_input_x);
weechat_log_printf (" win_input_y . . . . : %d\n", window->win_input_y);
weechat_log_printf (" win_input_width . . : %d\n", window->win_input_width);
weechat_log_printf (" win_input_height. . : %d\n", window->win_input_height);
weechat_log_printf (" win_input_cursor_x. : %d\n", window->win_input_cursor_x);
gui_window_objects_print_log (window);
weechat_log_printf (" dcc_first . . . . . : 0x%X\n", window->dcc_first);
weechat_log_printf (" dcc_selected. . . . : 0x%X\n", window->dcc_selected);
@@ -419,5 +436,4 @@ gui_window_print_log (t_gui_window *window)
weechat_log_printf (" start_line_pos. . . : %d\n", window->start_line_pos);
weechat_log_printf (" prev_window . . . . : 0x%X\n", window->prev_window);
weechat_log_printf (" next_window . . . . : 0x%X\n", window->next_window);
}
+24 -5
View File
@@ -21,9 +21,6 @@
#ifndef __WEECHAT_GUI_WINDOW_H
#define __WEECHAT_GUI_WINDOW_H 1
#define WINDOW_MIN_WIDTH 10
#define WINDOW_MIN_HEIGHT 5
/* window structures */
typedef struct t_gui_window_tree t_gui_window_tree;
@@ -54,9 +51,31 @@ struct t_gui_window
int win_nick_num_max; /* maximum number of nicks displayed */
int win_nick_start; /* # of 1st nick for display (scroll) */
/* title window settings */
int win_title_x; /* title window position */
int win_title_y; /* title window position */
int win_title_width; /* width of title window */
int win_title_height; /* height of title window */
/* status bar settings */
int win_status_x; /* status window position */
int win_status_y; /* status window position */
int win_status_width; /* width of status window */
int win_status_height; /* height of status window */
/* infobar bar settings */
int win_infobar_x; /* infobar window position */
int win_infobar_y; /* infobar window position */
int win_infobar_width; /* width of infobar window */
int win_infobar_height; /* height of infobar window */
/* input window settings */
int win_input_x; /* position of cursor in input window */
int win_input_x; /* input window position */
int win_input_y; /* input window position */
int win_input_width; /* width of input window */
int win_input_height; /* height of input window */
int win_input_cursor_x; /* position of cursor in input window */
/* GUI specific objects */
void *gui_objects; /* pointer to a GUI specific struct */
+3 -1
View File
@@ -100,8 +100,10 @@ extern void gui_buffer_move_to_number (t_gui_buffer *, int);
extern void gui_buffer_print_log (t_gui_buffer *);
/* panel */
extern int gui_panel_global_get_size (t_gui_panel *, int);
extern t_gui_panel *gui_panel_new (char *, int, int, int, int);
extern void gui_panel_free (t_gui_panel *);
extern void gui_panel_print_log ();
/* action */
extern void gui_action_clipboard_copy (char *, int);
@@ -220,7 +222,7 @@ extern void gui_status_draw (t_gui_buffer *, int);
extern void gui_input_draw (t_gui_buffer *, int);
/* nicklist */
extern void gui_nicklist_draw (t_gui_buffer *, int);
extern void gui_nicklist_draw (t_gui_buffer *, int, int);
/* window */
extern int gui_window_get_width ();
+1
View File
@@ -26,6 +26,7 @@ lib_weechat_irc_a_SOURCES = irc.h \
irc-server.c \
irc-channel.c \
irc-nick.c \
irc-mode.c \
irc-dcc.c \
irc-ignore.c \
irc-display.c
+33 -23
View File
@@ -32,6 +32,7 @@
#include "irc.h"
#include "../common/log.h"
#include "../common/utf8.h"
#include "../common/util.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"
@@ -60,9 +61,7 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name)
new_channel->dcc_chat = NULL;
new_channel->name = strdup (channel_name);
new_channel->topic = NULL;
new_channel->modes = (char *) malloc (NUM_CHANNEL_MODES + 1);
memset (new_channel->modes, ' ', NUM_CHANNEL_MODES);
new_channel->modes[NUM_CHANNEL_MODES] = '\0';
new_channel->modes = NULL;
new_channel->limit = 0;
new_channel->key = NULL;
new_channel->nicks_count = 0;
@@ -70,6 +69,7 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name)
new_channel->away_message = NULL;
new_channel->cycle = 0;
new_channel->close = 0;
new_channel->display_creation_date = 0;
new_channel->nicks = NULL;
new_channel->last_nick = NULL;
@@ -95,13 +95,18 @@ channel_free (t_irc_server *server, t_irc_channel *channel)
{
t_irc_channel *new_channels;
if (!server || !channel)
return;
/* close DCC CHAT */
if ((t_irc_dcc *)(channel->dcc_chat) &&
(!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status)))
if (channel->dcc_chat)
{
((t_irc_dcc *)(channel->dcc_chat))->channel = NULL;
dcc_close ((t_irc_dcc *)(channel->dcc_chat), DCC_ABORTED);
dcc_redraw (1);
if (!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status))
{
dcc_close ((t_irc_dcc *)(channel->dcc_chat), DCC_ABORTED);
dcc_redraw (1);
}
}
/* remove channel from queue */
@@ -123,6 +128,10 @@ channel_free (t_irc_server *server, t_irc_channel *channel)
free (channel->name);
if (channel->topic)
free (channel->topic);
if (channel->modes)
free (channel->modes);
if (channel->key)
free (channel->key);
nick_free_all (channel);
if (channel->away_message)
free (channel->away_message);
@@ -400,7 +409,7 @@ channel_remove_away (t_irc_channel *channel)
{
NICK_SET_FLAG(ptr_nick, 0, NICK_AWAY);
}
gui_nicklist_draw (channel->buffer, 0);
gui_nicklist_draw (channel->buffer, 0, 0);
}
}
@@ -539,19 +548,20 @@ void
channel_print_log (t_irc_channel *channel)
{
weechat_log_printf ("=> channel %s (addr:0x%X)]\n", channel->name, channel);
weechat_log_printf (" type . . . . : %d\n", channel->type);
weechat_log_printf (" dcc_chat . . : 0x%X\n", channel->dcc_chat);
weechat_log_printf (" topic. . . . : '%s'\n", channel->topic);
weechat_log_printf (" modes. . . . : '%s'\n", channel->modes);
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 (" cycle. . . . : %d\n", channel->cycle);
weechat_log_printf (" close. . . . : %d\n", channel->close);
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);
weechat_log_printf (" prev_channel : 0x%X\n", channel->prev_channel);
weechat_log_printf (" next_channel : 0x%X\n", channel->next_channel);
weechat_log_printf (" type . . . . . . . . : %d\n", channel->type);
weechat_log_printf (" dcc_chat . . . . . . : 0x%X\n", channel->dcc_chat);
weechat_log_printf (" topic. . . . . . . . : '%s'\n", channel->topic);
weechat_log_printf (" modes. . . . . . . . : '%s'\n", channel->modes);
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 (" cycle. . . . . . . . : %d\n", channel->cycle);
weechat_log_printf (" close. . . . . . . . : %d\n", channel->close);
weechat_log_printf (" display_creation_date: %d\n", channel->close);
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);
weechat_log_printf (" prev_channel . . . . : 0x%X\n", channel->prev_channel);
weechat_log_printf (" next_channel . . . . : 0x%X\n", channel->next_channel);
}
+15 -105
View File
@@ -156,7 +156,7 @@ t_irc_command irc_commands[] =
" s: mark a user for receive server notices\n"
" w: user receives wallops\n"
" o: operator flag"),
"", 1, MAX_ARGS, 0, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
"%c|%m", 1, MAX_ARGS, 0, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
{ "motd", N_("get the \"Message Of The Day\""),
N_("[target]"),
N_("target: server name"),
@@ -258,7 +258,7 @@ t_irc_command irc_commands[] =
N_("[channel] [topic]"),
N_("channel: channel name\ntopic: new topic for channel "
"(if topic is \"-delete\" then topic is deleted)"),
"%t", 0, MAX_ARGS, 1, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
"%t|-delete", 0, MAX_ARGS, 1, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
{ "trace", N_("find the route to specific server"),
N_("[target]"),
N_("target: server"),
@@ -288,7 +288,7 @@ t_irc_command irc_commands[] =
"set the 'w' user mode for themselves"),
N_("text"),
N_("text to send"),
NULL, 1, MAX_ARGS, 1, 1, NULL, irc_cmd_send_wallops, NULL },
NULL, 1, MAX_ARGS, 1, 1, NULL, irc_cmd_send_wallops, irc_cmd_recv_wallops },
{ "who", N_("generate a query which returns a list of information"),
N_("[mask [\"o\"]]"),
N_("mask: only information which match this mask\n"
@@ -306,75 +306,9 @@ t_irc_command irc_commands[] =
" target: reply should match this mask"),
"", 1, MAX_ARGS, 0, 1, NULL, irc_cmd_send_whowas, NULL },
{ "001", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "002", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "003", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "004", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
{ "005", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "006", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "007", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "008", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "020", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "042", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "212", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "219", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_001 },
{ "221", N_("user mode string"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
{ "250", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "251", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "252", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "253", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "254", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "255", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "256", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "257", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "258", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "259", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "260", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "261", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "262", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "263", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "264", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "265", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "266", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "267", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "268", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "269", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "290", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "292", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "301", N_("away message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
{ "302", N_("userhost"), "", "",
@@ -386,15 +320,15 @@ t_irc_command irc_commands[] =
{ "306", N_("now away"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "307", N_("whois (registered nick)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
{ "310", N_("available for help"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
{ "310", N_("whois (help mode)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_310 },
{ "311", N_("whois (user)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
{ "314", N_("whowas"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
{ "315", N_("end of /who list"), "", "",
@@ -402,11 +336,11 @@ t_irc_command irc_commands[] =
{ "317", N_("whois (idle)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
{ "318", N_("whois (end)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
{ "319", N_("whois (channels)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
{ "320", N_("whois (identified user)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
{ "321", N_("/list start"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
{ "322", N_("channel (for /list)"), "", "",
@@ -415,7 +349,9 @@ t_irc_command irc_commands[] =
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
{ "324", N_("channel mode"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
{ "329", "???", "", "",
{ "326", N_("whois (has oper privs)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_whois_nick_msg },
{ "329", N_("channel creation date"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
{ "331", N_("no topic for channel"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
@@ -426,6 +362,8 @@ t_irc_command irc_commands[] =
NULL, 2, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 },
{ "333", N_("infos about topic (nick and date changed)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "338", N_("whois (host)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_338 },
{ "341", N_("inviting"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "344", N_("channel reop"), "", "",
@@ -445,40 +383,14 @@ t_irc_command irc_commands[] =
N_("channel: name of channel\n"
" nick: nick on the channel"),
NULL, 2, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_353 },
{ "364", N_("links"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "365", N_("end of /links list"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "366", N_("end of /names list"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
{ "367", N_("banlist"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
{ "368", N_("end of banlist"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
{ "369", N_("end of /whowas list"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "371", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "372", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "373", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "374", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "375", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "376", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "378", N_("connecting from"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_378 },
{ "379", N_("using modes"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "381", N_("you are now an IRC operator"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "382", N_("rehashing"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "391", N_("server local time"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "401", N_("no such nick/channel"), "", "",
NULL, 0, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "402", N_("no such server"), "", "",
@@ -585,8 +497,6 @@ t_irc_command irc_commands[] =
NULL, 0, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "502", N_("can't change mode for other users"), "", "",
NULL, 0, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "505", N_("a server message"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "671", N_("whois (secure connection)"), "", "",
NULL, 0, 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ "973", N_("whois (secure connection)"), "", "",
+573 -187
View File
@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* irc-dcc.c: DCC communications (files & chat) */
/* irc-dcc.c: Direct Client-to-Client (DCC) communication (files & chat) */
#ifdef HAVE_CONFIG_H
@@ -26,12 +26,15 @@
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <stdarg.h>
#include <fcntl.h>
#include <time.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -41,11 +44,13 @@
#include "irc.h"
#include "../common/log.h"
#include "../common/hotlist.h"
#include "../common/util.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"
t_irc_dcc *dcc_list = NULL; /* DCC files & chat list */
t_irc_dcc *last_dcc = NULL; /* last DCC in list */
char *dcc_status_string[] = /* strings for DCC status */
{ N_("Waiting"), N_("Connecting"), N_("Active"), N_("Done"), N_("Failed"),
N_("Aborted") };
@@ -268,6 +273,49 @@ dcc_calculate_speed (t_irc_dcc *ptr_dcc, int ended)
}
}
/*
* dcc_connect_to_sender: connect to sender
*/
int
dcc_connect_to_sender (t_irc_dcc *ptr_dcc)
{
struct sockaddr_in addr;
struct hostent *hostent;
char *ip4;
int ret;
if (cfg_proxy_use)
{
memset (&addr, 0, sizeof (addr));
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
ip4 = inet_ntoa(addr.sin_addr);
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (cfg_proxy_port);
addr.sin_family = AF_INET;
if ((hostent = gethostbyname (cfg_proxy_address)) == NULL)
return 0;
memcpy(&(addr.sin_addr),*(hostent->h_addr_list), sizeof(struct in_addr));
ret = connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
if ((ret == -1) && (errno != EINPROGRESS))
return 0;
if (pass_proxy (ptr_dcc->sock, ip4, ptr_dcc->port, ptr_dcc->server->username) == -1)
return 0;
}
else
{
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (ptr_dcc->port);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
ret = connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
if ((ret == -1) && (errno != EINPROGRESS))
return 0;
}
return 1;
}
/*
* dcc_connect: connect to another host
*/
@@ -275,10 +323,6 @@ dcc_calculate_speed (t_irc_dcc *ptr_dcc, int ended)
int
dcc_connect (t_irc_dcc *ptr_dcc)
{
struct sockaddr_in addr;
struct hostent *hostent;
char *ip4;
if (ptr_dcc->type == DCC_CHAT_SEND)
ptr_dcc->status = DCC_WAITING;
else
@@ -291,47 +335,26 @@ dcc_connect (t_irc_dcc *ptr_dcc)
return 0;
}
/* for sending (chat or file), listen to socket for a connection */
/* for chat or file sending, listen to socket for a connection */
if (DCC_IS_SEND(ptr_dcc->type))
{
{
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
return 0;
if (listen (ptr_dcc->sock, 1) == -1)
return 0;
if (fcntl (ptr_dcc->sock, F_SETFL, 0) == -1)
return 0;
}
/* for receiving (chat or file), connect to listening host */
if (DCC_IS_RECV(ptr_dcc->type))
/* for chat receiving, connect to listening host */
if (ptr_dcc->type == DCC_CHAT_RECV)
{
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
if (cfg_proxy_use)
{
memset (&addr, 0, sizeof (addr));
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
ip4 = inet_ntoa(addr.sin_addr);
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (cfg_proxy_port);
addr.sin_family = AF_INET;
if ((hostent = gethostbyname (cfg_proxy_address)) == NULL)
return 0;
memcpy(&(addr.sin_addr),*(hostent->h_addr_list), sizeof(struct in_addr));
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
if (pass_proxy(ptr_dcc->sock, ip4, ptr_dcc->port, ptr_dcc->server->username) == -1)
return 0;
}
else
{
memset (&addr, 0, sizeof (addr));
addr.sin_port = htons (ptr_dcc->port);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = htonl (ptr_dcc->addr);
connect (ptr_dcc->sock, (struct sockaddr *) &addr, sizeof (addr));
}
return 0;
dcc_connect_to_sender (ptr_dcc);
}
/* for file receiving, connection is made in child process (blocking) socket */
return 1;
}
@@ -345,6 +368,9 @@ dcc_free (t_irc_dcc *ptr_dcc)
{
t_irc_dcc *new_dcc_list;
if (!ptr_dcc)
return;
/* DCC CHAT with channel => remove channel
(to prevent channel from becoming standard pv) */
if (ptr_dcc->channel)
@@ -354,11 +380,14 @@ dcc_free (t_irc_dcc *ptr_dcc)
|| (DCC_ENDED(((t_irc_dcc *)(ptr_dcc->channel->dcc_chat))->status)))
{
gui_buffer_free (ptr_dcc->channel->buffer, 1);
channel_free (ptr_dcc->server, ptr_dcc->channel);
if (ptr_dcc->channel)
channel_free (ptr_dcc->server, ptr_dcc->channel);
}
}
/* remove DCC from list */
if (last_dcc == ptr_dcc)
last_dcc = ptr_dcc->prev_dcc;
if (ptr_dcc->prev_dcc)
{
(ptr_dcc->prev_dcc)->next_dcc = ptr_dcc->next_dcc;
@@ -381,6 +410,34 @@ dcc_free (t_irc_dcc *ptr_dcc)
dcc_list = new_dcc_list;
}
/*
* dcc_file_child_kill: kill child process and close pipe
*/
void
dcc_file_child_kill (t_irc_dcc *ptr_dcc)
{
/* kill process */
if (ptr_dcc->child_pid > 0)
{
kill (ptr_dcc->child_pid, SIGKILL);
waitpid (ptr_dcc->child_pid, NULL, 0);
ptr_dcc->child_pid = 0;
}
/* close pipe used with child */
if (ptr_dcc->child_read != -1)
{
close (ptr_dcc->child_read);
ptr_dcc->child_read = -1;
}
if (ptr_dcc->child_write != -1)
{
close (ptr_dcc->child_write);
ptr_dcc->child_write = -1;
}
}
/*
* dcc_close: close a DCC connection
*/
@@ -419,6 +476,7 @@ dcc_close (t_irc_dcc *ptr_dcc, int status)
ptr_dcc->nick,
GUI_COLOR(COLOR_WIN_CHAT),
(status == DCC_DONE) ? _("OK") : _("FAILED"));
dcc_file_child_kill (ptr_dcc);
}
}
if (status == DCC_ABORTED)
@@ -543,24 +601,16 @@ dcc_recv_connect_init (t_irc_dcc *ptr_dcc)
}
else
{
ptr_dcc->status = DCC_ACTIVE;
/* DCC file => look for local filename and open it in writing mode */
/* DCC file => launch child process */
if (DCC_IS_FILE(ptr_dcc->type))
{
if (ptr_dcc->start_resume > 0)
ptr_dcc->file = open (ptr_dcc->local_filename,
O_APPEND | O_WRONLY | O_NONBLOCK);
else
ptr_dcc->file = open (ptr_dcc->local_filename,
O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK,
0644);
ptr_dcc->start_transfer = time (NULL);
ptr_dcc->last_check_time = time (NULL);
ptr_dcc->status = DCC_CONNECTING;
dcc_file_recv_fork (ptr_dcc);
}
else
{
/* DCC CHAT => associate DCC with channel */
ptr_dcc->status = DCC_ACTIVE;
dcc_channel_for_chat (ptr_dcc);
}
}
@@ -678,11 +728,16 @@ dcc_alloc ()
new_dcc->port = 0;
new_dcc->nick = NULL;
new_dcc->sock = -1;
new_dcc->child_pid = 0;
new_dcc->child_read = -1;
new_dcc->child_write = -1;
new_dcc->unterminated_message = NULL;
new_dcc->fast_send = cfg_dcc_fast_send;
new_dcc->file = -1;
new_dcc->filename = NULL;
new_dcc->local_filename = NULL;
new_dcc->filename_suffix = -1;
new_dcc->blocksize = cfg_dcc_blocksize;
new_dcc->size = 0;
new_dcc->pos = 0;
new_dcc->ack = 0;
@@ -697,6 +752,8 @@ dcc_alloc ()
new_dcc->next_dcc = dcc_list;
if (dcc_list)
dcc_list->prev_dcc = new_dcc;
else
last_dcc = new_dcc;
dcc_list = new_dcc;
return new_dcc;
@@ -1179,11 +1236,26 @@ dcc_chat_sendf (t_irc_dcc *ptr_dcc, char *fmt, ...)
void
dcc_chat_recv (t_irc_dcc *ptr_dcc)
{
fd_set read_fd;
static struct timeval timeout;
static char buffer[4096 + 2];
char *buf2, *pos, *ptr_buf, *ptr_buf2, *next_ptr_buf;
char *ptr_buf_color;
int num_read;
FD_ZERO (&read_fd);
FD_SET (ptr_dcc->sock, &read_fd);
timeout.tv_sec = 0;
timeout.tv_usec = 0;
/* something to read on socket? */
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) <= 0)
return;
if (!FD_ISSET (ptr_dcc->sock, &read_fd))
return;
/* there's something to read on socket! */
num_read = recv (ptr_dcc->sock, buffer, sizeof (buffer) - 2, 0);
if (num_read > 0)
{
@@ -1280,6 +1352,397 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
}
}
/*
* dcc_file_create_pipe: create pipe for communication with child process
* return 1 if ok, 0 if error
*/
int
dcc_file_create_pipe (t_irc_dcc *ptr_dcc)
{
int child_pipe[2];
if (pipe (child_pipe) < 0)
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to create pipe\n"),
WEECHAT_ERROR);
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
return 0;
}
ptr_dcc->child_read = child_pipe[0];
ptr_dcc->child_write = child_pipe[1];
return 1;
}
/*
* dcc_file_write_pipe: write data into pipe
*/
void
dcc_file_write_pipe (t_irc_dcc *ptr_dcc, int status, int error)
{
char buffer[1 + 1 + 12 + 1]; /* status + error + pos + \0 */
snprintf (buffer, sizeof (buffer), "%c%c%012lu",
status + '0', error + '0', ptr_dcc->pos);
write (ptr_dcc->child_write, buffer, sizeof (buffer));
}
/*
* dcc_file_send_child: child process for sending file
*/
void
dcc_file_send_child (t_irc_dcc *ptr_dcc)
{
int num_read, num_sent;
static char buffer[DCC_MAX_BLOCKSIZE];
uint32_t ack;
time_t last_sent, new_time;
last_sent = time (NULL);
while (1)
{
/* read DCC ACK (sent by receiver) */
if (ptr_dcc->pos > ptr_dcc->ack)
{
/* we should receive ACK for packets sent previously */
while (1)
{
num_read = recv (ptr_dcc->sock, (char *) &ack, 4, MSG_PEEK);
if ((num_read < 1) &&
((num_read != -1) || (errno != EAGAIN)))
{
dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_READ_LOCAL);
return;
}
if (num_read == 4)
{
recv (ptr_dcc->sock, (char *) &ack, 4, 0);
ptr_dcc->ack = ntohl (ack);
/* DCC send ok? */
if ((ptr_dcc->pos >= ptr_dcc->size)
&& (ptr_dcc->ack >= ptr_dcc->size))
{
dcc_file_write_pipe (ptr_dcc, DCC_DONE, DCC_NO_ERROR);
return;
}
}
else
break;
}
}
/* send a block to receiver */
if ((ptr_dcc->pos < ptr_dcc->size) &&
(ptr_dcc->fast_send || (ptr_dcc->pos <= ptr_dcc->ack)))
{
lseek (ptr_dcc->file, ptr_dcc->pos, SEEK_SET);
num_read = read (ptr_dcc->file, buffer, ptr_dcc->blocksize);
if (num_read < 1)
{
dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_READ_LOCAL);
return;
}
num_sent = send (ptr_dcc->sock, buffer, num_read, 0);
if (num_sent < 0)
{
/* socket is temporarily not available (receiver can't receive
amount of data we sent ?!) */
if (errno == EAGAIN)
usleep (1000);
else
{
dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_READ_LOCAL);
return;
}
}
if (num_sent > 0)
{
ptr_dcc->pos += (unsigned long) num_sent;
new_time = time (NULL);
if (last_sent != new_time)
{
last_sent = new_time;
dcc_file_write_pipe (ptr_dcc, DCC_ACTIVE, DCC_NO_ERROR);
}
}
}
else
usleep (1000);
}
}
/*
* dcc_file_recv_child: child process for receiving file
*/
void
dcc_file_recv_child (t_irc_dcc *ptr_dcc)
{
int num_read;
static char buffer[DCC_MAX_BLOCKSIZE];
uint32_t pos;
time_t last_sent, new_time;
/* first connect to sender (blocking) */
if (!dcc_connect_to_sender (ptr_dcc))
{
dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_CONNECT_SENDER);
return;
}
/* connection is ok, change DCC status (inform parent process) */
dcc_file_write_pipe (ptr_dcc, DCC_ACTIVE, DCC_NO_ERROR);
last_sent = time (NULL);
while (1)
{
num_read = recv (ptr_dcc->sock, buffer, sizeof (buffer), 0);
if (num_read == -1)
{
/* socket is temporarily not available (sender is not fast ?!) */
if (errno == EAGAIN)
usleep (1000);
else
{
dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_RECV_BLOCK);
return;
}
}
else
{
if (num_read == 0)
{
dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_RECV_BLOCK);
return;
}
if (write (ptr_dcc->file, buffer, num_read) == -1)
{
dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_WRITE_LOCAL);
return;
}
ptr_dcc->pos += (unsigned long) num_read;
pos = htonl (ptr_dcc->pos);
/* we don't check return code, not a problem if an ACK send failed */
send (ptr_dcc->sock, (char *) &pos, 4, 0);
/* file received ok? */
if (ptr_dcc->pos >= ptr_dcc->size)
{
dcc_file_write_pipe (ptr_dcc, DCC_DONE, DCC_NO_ERROR);
return;
}
new_time = time (NULL);
if (last_sent != new_time)
{
last_sent = new_time;
dcc_file_write_pipe (ptr_dcc, DCC_ACTIVE, DCC_NO_ERROR);
}
}
}
}
/*
* dcc_file_child_read: read data from child via pipe
*/
void
dcc_file_child_read (t_irc_dcc *ptr_dcc)
{
fd_set read_fd;
static struct timeval timeout;
char bufpipe[1 + 1 + 12 + 1];
int num_read;
char *error;
FD_ZERO (&read_fd);
FD_SET (ptr_dcc->child_read, &read_fd);
timeout.tv_sec = 0;
timeout.tv_usec = 0;
/* something to read on child pipe? */
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) <= 0)
return;
if (!FD_ISSET (ptr_dcc->child_read, &read_fd))
return;
/* there's something to read in pipe! */
num_read = read (ptr_dcc->child_read, bufpipe, sizeof (bufpipe));
if (num_read > 0)
{
error = NULL;
ptr_dcc->pos = strtol (bufpipe + 2, &error, 10);
ptr_dcc->last_activity = time (NULL);
dcc_calculate_speed (ptr_dcc, 0);
/* read error code */
switch (bufpipe[1] - '0')
{
/* errors for sender */
case DCC_ERROR_READ_LOCAL:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to read local file\n"),
WEECHAT_ERROR);
break;
case DCC_ERROR_SEND_BLOCK:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to send block to receiver\n"),
WEECHAT_ERROR);
break;
case DCC_ERROR_READ_ACK:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to read ACK from receiver\n"),
WEECHAT_ERROR);
break;
/* errors for receiver */
case DCC_ERROR_CONNECT_SENDER:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to connect to sender\n"),
WEECHAT_ERROR);
break;
case DCC_ERROR_RECV_BLOCK:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to receive block from sender\n"),
WEECHAT_ERROR);
break;
case DCC_ERROR_WRITE_LOCAL:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to write local file\n"),
WEECHAT_ERROR);
break;
}
/* read new DCC status */
switch (bufpipe[0] - '0')
{
case DCC_ACTIVE:
if (ptr_dcc->status == DCC_CONNECTING)
{
/* connection was successful by child, init transfert times */
ptr_dcc->status = DCC_ACTIVE;
ptr_dcc->start_transfer = time (NULL);
ptr_dcc->last_check_time = time (NULL);
dcc_redraw (HOTLIST_MSG);
}
else
dcc_redraw (HOTLIST_LOW);
break;
case DCC_DONE:
dcc_close (ptr_dcc, DCC_DONE);
dcc_redraw (HOTLIST_MSG);
break;
case DCC_FAILED:
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
break;
}
}
}
/*
* dcc_file_send_fork: fork process for sending file
*/
void
dcc_file_send_fork (t_irc_dcc *ptr_dcc)
{
pid_t pid;
if (!dcc_file_create_pipe (ptr_dcc))
return;
ptr_dcc->file = open (ptr_dcc->local_filename, O_RDONLY | O_NONBLOCK, 0644);
switch (pid = fork ())
{
/* fork failed */
case -1:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to fork\n"),
WEECHAT_ERROR);
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
return;
/* child process */
case 0:
setuid (getuid ());
dcc_file_send_child (ptr_dcc);
_exit (EXIT_SUCCESS);
}
/* parent process */
ptr_dcc->child_pid = pid;
}
/*
* dcc_file_recv_fork: fork process for receiving file
*/
void
dcc_file_recv_fork (t_irc_dcc *ptr_dcc)
{
pid_t pid;
if (!dcc_file_create_pipe (ptr_dcc))
return;
if (ptr_dcc->start_resume > 0)
ptr_dcc->file = open (ptr_dcc->local_filename,
O_APPEND | O_WRONLY | O_NONBLOCK);
else
ptr_dcc->file = open (ptr_dcc->local_filename,
O_CREAT | O_TRUNC | O_WRONLY | O_NONBLOCK,
0644);
switch (pid = fork ())
{
/* fork failed */
case -1:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to fork\n"),
WEECHAT_ERROR);
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
return;
/* child process */
case 0:
setuid (getuid ());
dcc_file_recv_child (ptr_dcc);
_exit (EXIT_SUCCESS);
}
/* parent process */
ptr_dcc->child_pid = pid;
}
/*
* dcc_handle: receive/send data for all active DCC
*/
@@ -1288,9 +1751,6 @@ void
dcc_handle ()
{
t_irc_dcc *ptr_dcc;
int num_read, num_sent;
static char buffer[102400];
uint32_t pos;
fd_set read_fd;
static struct timeval timeout;
int sock;
@@ -1304,6 +1764,11 @@ dcc_handle ()
{
if ((cfg_dcc_timeout != 0) && (time (NULL) > ptr_dcc->last_activity + cfg_dcc_timeout))
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: timeout\n"),
WEECHAT_ERROR);
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
continue;
@@ -1331,6 +1796,11 @@ dcc_handle ()
ptr_dcc->sock = -1;
if (sock < 0)
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to create socket for sending file\n"),
WEECHAT_ERROR);
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
continue;
@@ -1338,18 +1808,27 @@ dcc_handle ()
ptr_dcc->sock = sock;
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to set 'nonblock' option for socket\n"),
WEECHAT_ERROR);
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
ptr_dcc->status = DCC_ACTIVE;
ptr_dcc->file = open (ptr_dcc->local_filename, O_RDONLY | O_NONBLOCK, 0644);
ptr_dcc->start_transfer = time (NULL);
dcc_redraw (HOTLIST_MSG);
dcc_file_send_fork (ptr_dcc);
}
}
}
if (ptr_dcc->type == DCC_FILE_RECV)
{
dcc_file_child_read (ptr_dcc);
}
}
if (ptr_dcc->status == DCC_WAITING)
@@ -1395,113 +1874,9 @@ dcc_handle ()
if (ptr_dcc->status == DCC_ACTIVE)
{
if (DCC_IS_CHAT(ptr_dcc->type))
{
FD_ZERO (&read_fd);
FD_SET (ptr_dcc->sock, &read_fd);
timeout.tv_sec = 0;
timeout.tv_usec = 0;
/* something to read on socket? */
if (select (FD_SETSIZE, &read_fd, NULL, NULL, &timeout) > 0)
{
if (FD_ISSET (ptr_dcc->sock, &read_fd))
dcc_chat_recv (ptr_dcc);
}
}
if (ptr_dcc->type == DCC_FILE_RECV)
{
num_read = recv (ptr_dcc->sock, buffer, sizeof (buffer), 0);
if (num_read != -1)
{
if (num_read == 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
continue;
}
if (write (ptr_dcc->file, buffer, num_read) == -1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->last_activity = time (NULL);
ptr_dcc->pos += (unsigned long) num_read;
pos = htonl (ptr_dcc->pos);
send (ptr_dcc->sock, (char *) &pos, 4, 0);
dcc_calculate_speed (ptr_dcc, 0);
if (ptr_dcc->pos >= ptr_dcc->size)
{
dcc_close (ptr_dcc, DCC_DONE);
dcc_redraw (HOTLIST_MSG);
}
else
dcc_redraw (HOTLIST_LOW);
}
}
if (ptr_dcc->type == DCC_FILE_SEND)
{
if (cfg_dcc_blocksize > (int) sizeof (buffer))
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL, _("%s DCC failed because blocksize is too "
"big. Check value of \"dcc_blocksize\" option, "
"max is %d.\n"),
sizeof (buffer));
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
continue;
}
if (ptr_dcc->pos > ptr_dcc->ack)
{
/* we should receive ACK for packets sent previously */
num_read = recv (ptr_dcc->sock, (char *) &pos, 4, MSG_PEEK);
if (num_read != -1)
{
if (num_read == 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
continue;
}
if (num_read < 4)
continue;
recv (ptr_dcc->sock, (char *) &pos, 4, 0);
ptr_dcc->ack = ntohl (pos);
if ((ptr_dcc->pos >= ptr_dcc->size)
&& (ptr_dcc->ack >= ptr_dcc->size))
{
dcc_close (ptr_dcc, DCC_DONE);
dcc_redraw (HOTLIST_MSG);
continue;
}
}
}
if (ptr_dcc->pos <= ptr_dcc->ack)
{
lseek (ptr_dcc->file, ptr_dcc->pos, SEEK_SET);
num_read = read (ptr_dcc->file, buffer, cfg_dcc_blocksize);
if (num_read < 1)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
continue;
}
num_sent = send (ptr_dcc->sock, buffer, num_read, 0);
if (num_sent < 0)
{
dcc_close (ptr_dcc, DCC_FAILED);
dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->last_activity = time (NULL);
ptr_dcc->pos += (unsigned long) num_sent;
dcc_calculate_speed (ptr_dcc, 0);
dcc_redraw (HOTLIST_LOW);
}
}
dcc_chat_recv (ptr_dcc);
else
dcc_file_child_read (ptr_dcc);
}
}
}
@@ -1532,33 +1907,44 @@ dcc_end ()
*/
void
dcc_print_log (t_irc_dcc *dcc)
dcc_print_log ()
{
weechat_log_printf ("[DCC (addr:0x%X)]\n", dcc);
weechat_log_printf (" server. . . . . . . : 0x%X\n", dcc->server);
weechat_log_printf (" channel . . . . . . : 0x%X\n", dcc->channel);
weechat_log_printf (" type. . . . . . . . : %d\n", dcc->type);
weechat_log_printf (" status. . . . . . . : %d\n", dcc->status);
weechat_log_printf (" start_time. . . . . : %ld\n", dcc->start_time);
weechat_log_printf (" start_transfer. . . : %ld\n", dcc->start_transfer);
weechat_log_printf (" addr. . . . . . . . : %lu\n", dcc->addr);
weechat_log_printf (" port. . . . . . . . : %d\n", dcc->port);
weechat_log_printf (" nick. . . . . . . . : '%s'\n", dcc->nick);
weechat_log_printf (" sock. . . . . . . . : %d\n", dcc->sock);
weechat_log_printf (" unterminated_message: '%s'\n", dcc->unterminated_message);
weechat_log_printf (" file. . . . . . . . : %d\n", dcc->file);
weechat_log_printf (" filename. . . . . . : '%s'\n", dcc->filename);
weechat_log_printf (" local_filename. . . : '%s'\n", dcc->local_filename);
weechat_log_printf (" filename_suffix . . : %d\n", dcc->filename_suffix);
weechat_log_printf (" size. . . . . . . . : %lu\n", dcc->size);
weechat_log_printf (" pos . . . . . . . . : %lu\n", dcc->pos);
weechat_log_printf (" ack . . . . . . . . : %lu\n", dcc->ack);
weechat_log_printf (" start_resume. . . . : %lu\n", dcc->start_resume);
weechat_log_printf (" last_check_time . . : %ld\n", dcc->last_check_time);
weechat_log_printf (" last_check_pos. . . : %lu\n", dcc->last_check_pos);
weechat_log_printf (" last_activity . . . : %ld\n", dcc->last_activity);
weechat_log_printf (" bytes_per_sec . . . : %lu\n", dcc->bytes_per_sec);
weechat_log_printf (" eta . . . . . . . . : %lu\n", dcc->eta);
weechat_log_printf (" prev_dcc. . . . . . : 0x%X\n", dcc->prev_dcc);
weechat_log_printf (" next_dcc. . . . . . : 0x%X\n", dcc->next_dcc);
t_irc_dcc *ptr_dcc;
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
weechat_log_printf ("\n");
weechat_log_printf ("[DCC (addr:0x%X)]\n", ptr_dcc);
weechat_log_printf (" server. . . . . . . : 0x%X\n", ptr_dcc->server);
weechat_log_printf (" channel . . . . . . : 0x%X\n", ptr_dcc->channel);
weechat_log_printf (" type. . . . . . . . : %d\n", ptr_dcc->type);
weechat_log_printf (" status. . . . . . . : %d\n", ptr_dcc->status);
weechat_log_printf (" start_time. . . . . : %ld\n", ptr_dcc->start_time);
weechat_log_printf (" start_transfer. . . : %ld\n", ptr_dcc->start_transfer);
weechat_log_printf (" addr. . . . . . . . : %lu\n", ptr_dcc->addr);
weechat_log_printf (" port. . . . . . . . : %d\n", ptr_dcc->port);
weechat_log_printf (" nick. . . . . . . . : '%s'\n", ptr_dcc->nick);
weechat_log_printf (" sock. . . . . . . . : %d\n", ptr_dcc->sock);
weechat_log_printf (" child_pid . . . . . : %d\n", ptr_dcc->child_pid);
weechat_log_printf (" child_read. . . . . : %d\n", ptr_dcc->child_read);
weechat_log_printf (" child_write . . . . : %d\n", ptr_dcc->child_write);
weechat_log_printf (" unterminated_message: '%s'\n", ptr_dcc->unterminated_message);
weechat_log_printf (" fast_send . . . . . : %d\n", ptr_dcc->fast_send);
weechat_log_printf (" file. . . . . . . . : %d\n", ptr_dcc->file);
weechat_log_printf (" filename. . . . . . : '%s'\n", ptr_dcc->filename);
weechat_log_printf (" local_filename. . . : '%s'\n", ptr_dcc->local_filename);
weechat_log_printf (" filename_suffix . . : %d\n", ptr_dcc->filename_suffix);
weechat_log_printf (" blocksize . . . . . : %d\n", ptr_dcc->blocksize);
weechat_log_printf (" size. . . . . . . . : %lu\n", ptr_dcc->size);
weechat_log_printf (" pos . . . . . . . . : %lu\n", ptr_dcc->pos);
weechat_log_printf (" ack . . . . . . . . : %lu\n", ptr_dcc->ack);
weechat_log_printf (" start_resume. . . . : %lu\n", ptr_dcc->start_resume);
weechat_log_printf (" last_check_time . . : %ld\n", ptr_dcc->last_check_time);
weechat_log_printf (" last_check_pos. . . : %lu\n", ptr_dcc->last_check_pos);
weechat_log_printf (" last_activity . . . : %ld\n", ptr_dcc->last_activity);
weechat_log_printf (" bytes_per_sec . . . : %lu\n", ptr_dcc->bytes_per_sec);
weechat_log_printf (" eta . . . . . . . . : %lu\n", ptr_dcc->eta);
weechat_log_printf (" prev_dcc. . . . . . : 0x%X\n", ptr_dcc->prev_dcc);
weechat_log_printf (" next_dcc. . . . . . : 0x%X\n", ptr_dcc->next_dcc);
}
}
+1 -1
View File
@@ -171,7 +171,7 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
length += strlen (cfg_look_nick_prefix);
if (external_nick)
length += 2;
if (nick)
if (nick && cfg_look_nickmode)
{
if (nick->flags & (NICK_CHANOWNER | NICK_CHANADMIN |
NICK_OP | NICK_HALFOP | NICK_VOICE))
+1
View File
@@ -31,6 +31,7 @@
#include "irc.h"
#include "../common/command.h"
#include "../common/log.h"
#include "../common/util.h"
char *ignore_types[] =
+251
View File
@@ -0,0 +1,251 @@
/*
* Copyright (c) 2003-2006 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* irc-mode.c: IRC channel/user modes management */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
#include "../gui/gui.h"
/*
* irc_mode_channel_set_nick: set a mode for a nick on a channel
*/
void
irc_mode_channel_set_nick (t_irc_channel *channel, char *nick,
char set_flag, int flag)
{
t_irc_nick *ptr_nick;
if (nick)
{
ptr_nick = nick_search (channel, nick);
if (ptr_nick)
{
NICK_SET_FLAG(ptr_nick, (set_flag == '+'), flag);
nick_resort (channel, ptr_nick);
gui_nicklist_draw (channel->buffer, 1, 1);
}
}
}
/*
* irc_mode_channel_get_flag: search for flag before current position
*/
char
irc_mode_channel_get_flag (char *str, char *pos)
{
char set_flag;
set_flag = '+';
pos--;
while (pos >= str)
{
if (pos[0] == '-')
return '-';
if (pos[0] == '+')
return '+';
pos--;
}
return set_flag;
}
/*
* irc_mode_channel_set: set channel modes
*/
void
irc_mode_channel_set (t_irc_channel *channel, char *modes)
{
char *pos_args, set_flag, **argv, *pos, *ptr_arg;
int argc, current_arg;
argc = 0;
argv = NULL;
current_arg = 0;
pos_args = strchr (modes, ' ');
if (pos_args)
{
pos_args[0] = '\0';
pos_args++;
while (pos_args[0] == ' ')
pos_args++;
argv = explode_string (pos_args, " ", 0, &argc);
if (argc > 0)
current_arg = argc - 1;
}
if (modes && modes[0])
{
set_flag = '+';
pos = modes + strlen (modes) - 1;
while (pos >= modes)
{
switch (pos[0])
{
case ':':
case ' ':
case '+':
case '-':
break;
default:
set_flag = irc_mode_channel_get_flag (modes, pos);
ptr_arg = ((argc > 0) && (current_arg >= 0)) ?
argv[current_arg--] : NULL;
switch (pos[0])
{
case 'h':
irc_mode_channel_set_nick (channel, ptr_arg,
set_flag, NICK_HALFOP);
break;
case 'k':
if (channel->key)
{
free (channel->key);
channel->key = NULL;
}
if ((set_flag == '+') && ptr_arg)
channel->key = strdup (ptr_arg);
break;
case 'l':
if (set_flag == '-')
channel->limit = 0;
if ((set_flag == '+') && ptr_arg)
channel->limit = atoi (ptr_arg);
break;
case 'o':
irc_mode_channel_set_nick (channel, ptr_arg,
set_flag, NICK_OP);
break;
case 'v':
irc_mode_channel_set_nick (channel, ptr_arg,
set_flag, NICK_VOICE);
break;
}
break;
}
pos--;
}
}
if (argv)
free_exploded_string (argv);
}
/*
* irc_mode_user_add: add a user mode
*/
void
irc_mode_user_add (t_irc_server *server, char mode)
{
char str_mode[2];
str_mode[0] = mode;
str_mode[1] = '\0';
if (server->nick_modes)
{
if (!strchr (server->nick_modes, mode))
{
server->nick_modes = (char *) realloc (server->nick_modes,
strlen (server->nick_modes) + 1 + 1);
strcat (server->nick_modes, str_mode);
gui_status_draw (gui_current_window->buffer, 1);
gui_input_draw (gui_current_window->buffer, 1);
}
}
else
{
server->nick_modes = (char *) malloc (2);
strcpy (server->nick_modes, str_mode);
gui_status_draw (gui_current_window->buffer, 1);
gui_input_draw (gui_current_window->buffer, 1);
}
}
/*
* irc_mode_user_remove: remove a user mode
*/
void
irc_mode_user_remove (t_irc_server *server, char mode)
{
char *pos;
int new_size;
if (server->nick_modes)
{
pos = strchr (server->nick_modes, mode);
if (pos)
{
new_size = strlen (server->nick_modes);
memmove (pos, pos + 1, strlen (pos + 1) + 1);
server->nick_modes = (char *) realloc (server->nick_modes,
new_size);
gui_status_draw (gui_current_window->buffer, 1);
gui_input_draw (gui_current_window->buffer, 1);
}
}
}
/*
* irc_mode_user_set: set user modes
*/
void
irc_mode_user_set (t_irc_server *server, char *modes)
{
char set_flag;
set_flag = '+';
while (modes && modes[0])
{
switch (modes[0])
{
case ':':
case ' ':
break;
case '+':
set_flag = '+';
break;
case '-':
set_flag = '-';
break;
default:
if (set_flag == '+')
irc_mode_user_add (server, modes[0]);
else
irc_mode_user_remove (server, modes[0]);
break;
}
modes++;
}
}
+9 -2
View File
@@ -31,6 +31,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/log.h"
#include "../common/util.h"
#include "../common/weeconfig.h"
@@ -267,7 +268,10 @@ void
nick_free (t_irc_channel *channel, t_irc_nick *nick)
{
t_irc_nick *new_nicks;
if (!channel || !nick)
return;
/* remove nick from queue */
if (channel->last_nick == nick)
channel->last_nick = nick->prev_nick;
@@ -300,6 +304,9 @@ nick_free (t_irc_channel *channel, t_irc_nick *nick)
void
nick_free_all (t_irc_channel *channel)
{
if (!channel)
return;
/* remove all nicks for the channel */
while (channel->nicks)
nick_free (channel, channel->nicks);
@@ -402,7 +409,7 @@ nick_set_away (t_irc_channel *channel, t_irc_nick *nick, int is_away)
((!is_away) && (nick->flags & NICK_AWAY)))
{
NICK_SET_FLAG(nick, is_away, NICK_AWAY);
gui_nicklist_draw (channel->buffer, 0);
gui_nicklist_draw (channel->buffer, 0, 0);
}
}
}
+371 -826
View File
File diff suppressed because it is too large Load Diff
+51 -20
View File
@@ -39,6 +39,7 @@
#include "../common/weechat.h"
#include "irc.h"
#include "../common/command.h"
#include "../common/util.h"
#include "../common/weeconfig.h"
#include "../gui/gui.h"
@@ -243,6 +244,11 @@ irc_send_away (t_irc_server *server, char *arguments)
if (arguments)
{
server->is_away = 1;
if (server->away_message)
free (server->away_message);
server->away_message = (char *) malloc (strlen (arguments) + 1);
if (server->away_message)
strcpy (server->away_message, arguments);
server->away_time = time (NULL);
server_sendf (server, "AWAY :%s\r\n", arguments);
if (cfg_irc_display_away != CFG_IRC_DISPLAY_AWAY_OFF)
@@ -271,6 +277,11 @@ irc_send_away (t_irc_server *server, char *arguments)
{
server_sendf (server, "AWAY\r\n");
server->is_away = 0;
if (server->away_message)
{
free (server->away_message);
server->away_message = NULL;
}
if (server->away_time != 0)
{
time_now = time (NULL);
@@ -1531,17 +1542,25 @@ irc_cmd_send_part (t_irc_server *server, t_irc_channel *channel,
}
else
{
if (!CHANNEL(buffer))
{
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel or private buffer\n"),
WEECHAT_ERROR, "part");
return -1;
}
channel_name = CHANNEL(buffer)->name;
pos_args = arguments;
}
}
else
{
if (BUFFER_IS_SERVER(buffer))
if (!CHANNEL(buffer))
{
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can not be executed on a server buffer\n"),
_("%s \"%s\" command can only be executed in a channel or private buffer\n"),
WEECHAT_ERROR, "part");
return -1;
}
@@ -1680,6 +1699,34 @@ irc_cmd_send_query (t_irc_server *server, t_irc_channel *channel,
return 0;
}
/*
* irc_send_quit_server: send QUIT to a server
*/
void
irc_send_quit_server (t_irc_server *server, char *arguments)
{
char *ptr_arg, *buf;
if (server->is_connected)
{
ptr_arg = (arguments) ? arguments :
(cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0]) ?
cfg_irc_default_msg_quit : NULL;
if (ptr_arg)
{
buf = weechat_strreplace (ptr_arg, "%v", PACKAGE_VERSION);
server_sendf (server, "QUIT :%s\r\n",
(buf) ? buf : ptr_arg);
if (buf)
free (buf);
}
else
server_sendf (server, "QUIT\r\n");
}
}
/*
* irc_cmd_send_quit: disconnect from all servers and quit WeeChat
*/
@@ -1689,31 +1736,15 @@ irc_cmd_send_quit (t_irc_server *server, t_irc_channel *channel,
char *arguments)
{
t_irc_server *ptr_server;
char *ptr_arg, *buf;
/* make gcc happy */
(void) server;
(void) channel;
ptr_arg = (arguments) ? arguments :
(cfg_irc_default_msg_quit && cfg_irc_default_msg_quit[0]) ?
cfg_irc_default_msg_quit : NULL;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (ptr_server->is_connected)
{
if (ptr_arg)
{
buf = weechat_strreplace (ptr_arg, "%v", PACKAGE_VERSION);
server_sendf (ptr_server, "QUIT :%s\r\n",
(buf) ? buf : ptr_arg);
if (buf)
free (buf);
}
else
server_sendf (ptr_server, "QUIT\r\n");
}
irc_send_quit_server (ptr_server, arguments);
}
quit_weechat = 1;
return 0;
@@ -2169,7 +2200,7 @@ irc_cmd_send_wallops (t_irc_server *server, t_irc_channel *channel,
/* make gcc happy */
(void) channel;
server_sendf (server, "WALLOPS %s\r\n", arguments);
server_sendf (server, "WALLOPS :%s\r\n", arguments);
return 0;
}
+27 -14
View File
@@ -102,12 +102,11 @@ server_init (t_irc_server *server)
server->ssl_connected = 0;
server->unterminated_message = NULL;
server->nick = NULL;
server->nick_modes = (char *) malloc (NUM_NICK_MODES + 1);
memset (server->nick_modes, ' ', NUM_NICK_MODES);
server->nick_modes[NUM_NICK_MODES] = '\0';
server->nick_modes = NULL;
server->reconnect_start = 0;
server->reconnect_join = 0;
server->is_away = 0;
server->away_message = NULL;
server->away_time = 0;
server->lag = 0;
server->lag_check_time.tv_sec = 0;
@@ -283,6 +282,9 @@ server_alloc ()
void
server_destroy (t_irc_server *server)
{
if (!server)
return;
/* free data */
if (server->name)
free (server->name);
@@ -320,6 +322,8 @@ server_destroy (t_irc_server *server)
free (server->nick);
if (server->nick_modes)
free (server->nick_modes);
if (server->away_message)
free (server->away_message);
if (server->channels)
channel_free_all (server);
}
@@ -333,6 +337,9 @@ server_free (t_irc_server *server)
{
t_irc_server *new_irc_servers;
if (!server)
return;
/* close any opened channel/private */
while (server->channels)
channel_free (server, server->channels);
@@ -759,9 +766,14 @@ server_msgq_flush ()
if (ptr_data[0] == ':')
{
pos = strchr (ptr_data, ' ');
pos[0] = '\0';
host = ptr_data + 1;
pos++;
if (pos)
{
pos[0] = '\0';
host = ptr_data + 1;
pos++;
}
else
pos = ptr_data;
}
else
pos = ptr_data;
@@ -859,11 +871,11 @@ server_recv (t_irc_server *server)
}
/*
* server_kill_child: kill child process and close pipe
* server_child_kill: kill child process and close pipe
*/
void
server_kill_child (t_irc_server *server)
server_child_kill (t_irc_server *server)
{
/* kill process */
if (server->child_pid > 0)
@@ -893,7 +905,7 @@ server_kill_child (t_irc_server *server)
void
server_close_connection (t_irc_server *server)
{
server_kill_child (server);
server_child_kill (server);
/* close network socket */
if (server->sock != -1)
@@ -951,7 +963,7 @@ server_child_read (t_irc_server *server)
int num_read;
num_read = read (server->child_read, buffer, sizeof (buffer));
if (num_read != -1)
if (num_read > 0)
{
switch (buffer[0])
{
@@ -976,7 +988,7 @@ server_child_read (t_irc_server *server)
}
#endif
/* kill child and login to server */
server_kill_child (server);
server_child_kill (server);
irc_login (server);
break;
/* adress not found */
@@ -1662,7 +1674,7 @@ server_connect (t_irc_server *server)
_exit (EXIT_SUCCESS);
}
/* parent process go on here */
/* parent process */
server->child_pid = pid;
return 1;
@@ -1741,8 +1753,8 @@ server_disconnect (t_irc_server *server, int reconnect)
if (server->nick_modes)
{
memset (server->nick_modes, ' ', NUM_NICK_MODES);
server->nick_modes[NUM_NICK_MODES] = '\0';
free (server->nick_modes);
server->nick_modes = NULL;
}
server->is_away = 0;
server->away_time = 0;
@@ -1969,6 +1981,7 @@ server_print_log (t_irc_server *server)
weechat_log_printf (" reconnect_start . . : %ld\n", server->reconnect_start);
weechat_log_printf (" reconnect_join. . . : %d\n", server->reconnect_join);
weechat_log_printf (" is_away . . . . . . : %d\n", server->is_away);
weechat_log_printf (" away_message. . . . : '%s'\n", server->away_message);
weechat_log_printf (" away_time . . . . . : %ld\n", server->away_time);
weechat_log_printf (" lag . . . . . . . . : %d\n", server->lag);
weechat_log_printf (" lag_check_time. . . : tv_sec:%d, tv_usec:%d\n",
+60 -51
View File
@@ -85,21 +85,6 @@ struct t_irc_nick
#define CHANNEL_TYPE_PRIVATE 1
#define CHANNEL_TYPE_DCC_CHAT 2
#define NUM_CHANNEL_MODES 8
#define CHANNEL_MODE_INVITE 0
#define CHANNEL_MODE_KEY 1
#define CHANNEL_MODE_LIMIT 2
#define CHANNEL_MODE_MODERATED 3
#define CHANNEL_MODE_NO_MSG_OUT 4
#define CHANNEL_MODE_SECRET 5
#define CHANNEL_MODE_TOPIC 6
#define CHANNEL_MODE_PRIVATE 7
#define CHANNEL_SET_MODE(channel, set, mode) \
if (set) \
channel->modes[mode] = channel_modes[mode]; \
else \
channel->modes[mode] = ' ';
typedef struct t_irc_channel t_irc_channel;
struct t_irc_channel
@@ -116,6 +101,7 @@ struct t_irc_channel
char *away_message; /* to display away only once in private */
int cycle; /* currently cycling (/part then /join) */
int close; /* close request (/buffer close) */
int display_creation_date; /* 1 if creation date should be displayed */
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 */
@@ -125,20 +111,6 @@ struct t_irc_channel
/* server types */
#define NUM_NICK_MODES 7
#define NICK_MODE_AWAY 0
#define NICK_MODE_INVISIBLE 1
#define NICK_MODE_WALLOPS 2
#define NICK_MODE_RESTRICTED 3
#define NICK_MODE_OPERATOR 4
#define NICK_MODE_LOCAL_OPERATOR 5
#define NICK_MODE_SERVER_NOTICES 6
#define NICK_SET_MODE(server, set, mode) \
if (set) \
server->nick_modes[mode] = nick_modes[mode]; \
else \
server->nick_modes[mode] = ' ';
typedef struct t_irc_server t_irc_server;
struct t_irc_server
@@ -184,7 +156,8 @@ struct t_irc_server
char *nick_modes; /* nick modes */
time_t reconnect_start; /* this time + delay = reconnect time */
int reconnect_join; /* 1 if channels opened to rejoin */
int is_away; /* 1 is user is marker as away */
int is_away; /* 1 is user is marked as away */
char *away_message; /* away message, NULL if not away */
time_t away_time; /* time() when user marking as away */
int lag; /* lag (in milliseconds) */
struct timeval lag_check_time; /* last time lag was checked (ping sent) */
@@ -200,6 +173,8 @@ struct t_irc_server
/* irc commands */
typedef int (t_irc_recv_func)(t_irc_server *, char *, char *, char *);
typedef struct t_irc_command t_irc_command;
struct t_irc_command
@@ -211,15 +186,14 @@ struct t_irc_command
char *completion_template; /* template for completion */
/* NULL=no completion, ""=default (nick) */
int min_arg, max_arg; /* min & max number of arguments */
int charset_conversion; /* = 1 if cmd args are converted before */
/* they're sent to server */
int conversion; /* = 1 if cmd args are converted (charset */
/* and color) before sending to server */
int needs_connection; /* = 1 if cmd needs server connection */
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 *, 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 */
t_irc_recv_func *recv_function; /* function called when cmd is received */
};
/* irc messages */
@@ -235,23 +209,44 @@ struct t_irc_message
/* DCC types */
#define DCC_CHAT_RECV 0 /* receiving DCC chat */
#define DCC_CHAT_SEND 1 /* sending DCC chat */
#define DCC_FILE_RECV 2 /* incoming DCC file */
#define DCC_FILE_SEND 3 /* sending DCC file */
#define DCC_CHAT_RECV 0 /* receiving DCC chat */
#define DCC_CHAT_SEND 1 /* sending DCC chat */
#define DCC_FILE_RECV 2 /* incoming DCC file */
#define DCC_FILE_SEND 3 /* sending DCC file */
#define DCC_WAITING 0 /* waiting for host answer */
#define DCC_CONNECTING 1 /* connecting to host */
#define DCC_ACTIVE 2 /* sending/receiving data */
#define DCC_DONE 3 /* transfer done */
#define DCC_FAILED 4 /* DCC failed */
#define DCC_ABORTED 5 /* DCC aborted by user */
/* DCC status */
#define DCC_WAITING 0 /* waiting for host answer */
#define DCC_CONNECTING 1 /* connecting to host */
#define DCC_ACTIVE 2 /* sending/receiving data */
#define DCC_DONE 3 /* transfer done */
#define DCC_FAILED 4 /* DCC failed */
#define DCC_ABORTED 5 /* DCC aborted by user */
/* DCC blocksize (for file) */
#define DCC_MIN_BLOCKSIZE 1024 /* min DCC block size when sending file */
#define DCC_MAX_BLOCKSIZE 102400 /* max DCC block size when sending file */
/* DCC errors (for file) */
#define DCC_NO_ERROR 0 /* used when no error to report, all ok! */
#define DCC_ERROR_READ_LOCAL 1 /* unable to read local file */
#define DCC_ERROR_SEND_BLOCK 2 /* unable to send block to receiver */
#define DCC_ERROR_READ_ACK 3 /* unable to read ACK from receiver */
#define DCC_ERROR_CONNECT_SENDER 4 /* unable to connect to sender */
#define DCC_ERROR_RECV_BLOCK 5 /* unable to receive block from sender */
#define DCC_ERROR_WRITE_LOCAL 6 /* unable to write to local file */
/* DCC macros for type */
#define DCC_IS_CHAT(type) ((type == DCC_CHAT_RECV) || (type == DCC_CHAT_SEND))
#define DCC_IS_FILE(type) ((type == DCC_FILE_RECV) || (type == DCC_FILE_SEND))
#define DCC_IS_RECV(type) ((type == DCC_CHAT_RECV) || (type == DCC_FILE_RECV))
#define DCC_IS_SEND(type) ((type == DCC_CHAT_SEND) || (type == DCC_FILE_SEND))
/* DCC macro for status */
#define DCC_ENDED(status) ((status == DCC_DONE) || (status == DCC_FAILED) || \
(status == DCC_ABORTED))
@@ -261,7 +256,7 @@ struct t_irc_dcc
{
t_irc_server *server; /* irc server */
t_irc_channel *channel; /* irc channel (for DCC chat only) */
int type; /* DCC type (send or receive) */
int type; /* DCC type (file/chat, send/receive) */
int status; /* DCC status (waiting, sending, ..) */
time_t start_time; /* the time when DCC started */
time_t start_transfer; /* the time when DCC transfer started */
@@ -269,11 +264,16 @@ struct t_irc_dcc
int port; /* port */
char *nick; /* remote nick */
int sock; /* socket for connection */
pid_t child_pid; /* pid of child process (sending/recving) */
int child_read; /* to read into child pipe */
int child_write; /* to write into child pipe */
char *unterminated_message; /* beginning of a message in input buf */
int fast_send; /* fase send for files: does not wait ACK */
int file; /* local file (for reading or writing) */
char *filename; /* filename (given by sender) */
char *local_filename; /* local filename (with path) */
int filename_suffix; /* suffix (.1 for ex) if renaming file */
int blocksize; /* block size for sending file */
unsigned long size; /* file size */
unsigned long pos; /* number of bytes received/sent */
unsigned long ack; /* number of bytes received OK */
@@ -316,6 +316,7 @@ extern t_irc_server *irc_servers;
extern t_irc_message *recv_msgq, *msgq_last_msg;
extern int check_away;
extern t_irc_dcc *dcc_list;
extern t_irc_dcc *last_dcc;
extern char *dcc_status_string[6];
extern char *channel_modes;
extern char *nick_modes;
@@ -403,6 +404,11 @@ extern int nick_get_max_length (t_irc_channel *);
extern void nick_set_away (t_irc_channel *, t_irc_nick *, int);
extern void nick_print_log (t_irc_nick *);
/* mode functions (irc-mode.c) */
extern void irc_mode_channel_set (t_irc_channel *, char *);
extern void irc_mode_user_set (t_irc_server *, char *);
/* DCC functions (irc-dcc.c) */
extern void dcc_redraw (int);
@@ -417,9 +423,11 @@ extern t_irc_dcc *dcc_add (t_irc_server *, int, unsigned long, int, char *, int,
char *, char *, unsigned long);
extern void dcc_send_request (t_irc_server *, int, char *, char *);
extern void dcc_chat_sendf (t_irc_dcc *, char *, ...);
extern void dcc_file_send_fork (t_irc_dcc *);
extern void dcc_file_recv_fork (t_irc_dcc *);
extern void dcc_handle ();
extern void dcc_end ();
extern void dcc_print_log (t_irc_dcc *);
extern void dcc_print_log ();
/* IRC display (irc-diplay.c) */
@@ -439,6 +447,7 @@ extern void irc_login (t_irc_server *);
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 void irc_send_away (t_irc_server *, 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 *);
@@ -471,6 +480,7 @@ 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 void irc_send_quit_server (t_irc_server *, 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 *);
@@ -515,24 +525,22 @@ extern int irc_cmd_recv_server_mode_reason (t_irc_server *, char *, char *, char
extern int irc_cmd_recv_server_msg (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_server_reply (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_topic (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_wallops (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_001 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_004 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_221 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_301 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_302 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_303 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_305 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_306 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_307 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_whois_nick_msg (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_310 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_311 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_312 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_313 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_314 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_315 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_317 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_318 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_319 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_320 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_321 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_322 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_323 (t_irc_server *, char *, char *, char *);
@@ -541,6 +549,7 @@ extern int irc_cmd_recv_329 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_331 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_332 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_333 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_338 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_341 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_344 (t_irc_server *, char *, char *, char *);
extern int irc_cmd_recv_345 (t_irc_server *, char *, char *, char *);
+5 -1
View File
@@ -33,7 +33,11 @@ if PLUGIN_LUA
script_dir = scripts
endif
SUBDIRS = $(script_dir)
if PLUGIN_ASPELL
aspell_dir = aspell
endif
SUBDIRS = $(script_dir) $(aspell_dir)
noinst_LIBRARIES = lib_weechat_plugins.a
+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\" $(ASPELL_CFLAGS)
libdir = ${weechat_libdir}/plugins
lib_LTLIBRARIES = aspell.la
aspell_la_SOURCES = weechat-aspell.h weechat-aspell.c
aspell_la_LDFLAGS = -module
aspell_la_LIBADD = $(ASPELL_LFLAGS)

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