mirror of
https://github.com/weechat/weechat.git
synced 2026-06-21 18:36:39 +02:00
Compare commits
109 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| be6594afb7 | |||
| f6d46b8792 | |||
| 83852ca3ab | |||
| a4695f5ba2 | |||
| 8c54d55611 | |||
| 8b5137ddeb | |||
| b3b1ab104b | |||
| 05992a34f3 | |||
| 224cd3ff59 | |||
| b1f83dce8a | |||
| dd39ac2432 | |||
| 05456cc54e | |||
| 3fd569a83e | |||
| 978efc0d4f | |||
| b409b42470 | |||
| 0369660c0e | |||
| 457c786fbe | |||
| 4d62625894 | |||
| d875b52124 | |||
| 1704595452 | |||
| d06e847efe | |||
| b10b53c689 | |||
| 96a9a1df90 | |||
| 70e0f05ff2 | |||
| 43093b13fa | |||
| c771db23fe | |||
| 18e47000f4 | |||
| ac8c68bd68 | |||
| 4f0dc2984b | |||
| 88ee7addbc | |||
| d3bfff3d65 | |||
| b0d10367d3 | |||
| 63d728a6a1 | |||
| 503350f46b | |||
| 7c1c8cd874 | |||
| d280bf2a92 | |||
| f4513bbadd | |||
| 77b504cd3f | |||
| 04fda8a314 | |||
| d5b58ff068 | |||
| 6eabc3aa61 | |||
| c08c40a1c6 | |||
| 1c4056a3b6 | |||
| 756f7354e9 | |||
| ceaf9fa287 | |||
| 54baad1848 | |||
| 11da868d70 | |||
| acb40634b0 | |||
| 290c603321 | |||
| 77e00d0381 | |||
| b8662d79c2 | |||
| f9a4a0dd01 | |||
| 59f6997cf0 | |||
| 76891f9037 | |||
| b7286b7e9f | |||
| c1b4ccace4 | |||
| 1984e7f0f5 | |||
| 7a80558d0f | |||
| 0ef010d211 | |||
| 6c7a71976b | |||
| 74b84ae163 | |||
| 81224d9397 | |||
| a114b7adc3 | |||
| 8e696af49a | |||
| 4f1e90f68f | |||
| 6efb8e4439 | |||
| c005d8c4d3 | |||
| 816fac5084 | |||
| b821783bbf | |||
| 62bc46cb1d | |||
| a477f29cf8 | |||
| ea3d7c278d | |||
| 6cfb01f363 | |||
| f035f768ad | |||
| b38f7b6d17 | |||
| 163ded5658 | |||
| 80ed16c3c0 | |||
| 1b7f628457 | |||
| 578a57812f | |||
| 83b82e1d7d | |||
| 4ea27db1d7 | |||
| 470e8a0296 | |||
| 9f0aedd319 | |||
| c71f869106 | |||
| e750eaecfa | |||
| 5a970dffbb | |||
| d5affecc23 | |||
| 967d436a1d | |||
| ef0e468415 | |||
| 2229d34110 | |||
| f29a08bc47 | |||
| 6d931f27c3 | |||
| 3eaf388bce | |||
| cea353d34d | |||
| 85f20851d8 | |||
| f2402d4be2 | |||
| 0cf9d16bb9 | |||
| fd7d98134d | |||
| 8cab953c6f | |||
| b81fa36a5c | |||
| e63da66644 | |||
| 3a2fdde999 | |||
| 4df45530c3 | |||
| d73597d69f | |||
| 47c3266952 | |||
| b081d831e6 | |||
| 9b371e9ae7 | |||
| 483d4670e1 | |||
| 92a2a0774c |
@@ -36,6 +36,8 @@ Contributors:
|
||||
Rudolf Polzer <rpolzer-rp@durchnull.de> (IRC: "divVerent")
|
||||
Jiri Golembiovsky <golemj@gmail.com> (IRC: "GolemJ")
|
||||
Jim Ramsay <i.am@jimramsay.com> (IRC: "lack")
|
||||
Odin <odin@dtdm.org> (IRC: "[Odin]")
|
||||
Pistos (IRC: "pistos")
|
||||
|
||||
|
||||
=====
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
WeeChat known bugs, 2005-11-11
|
||||
WeeChat known bugs, 2006-01-14
|
||||
|
||||
- display bugs with UTF-8 chars coded on more than 2 bytes
|
||||
- divide long messages (> 512 bytes) into more messages so IRC server can
|
||||
parse them correctly
|
||||
- some refresh bugs with splited windows
|
||||
- ./configure does not check that Ruby libraries are installed
|
||||
- ./configure does not check that Gtk 2.0 libraries are installed
|
||||
- when quitting WeeChat term title is not restored (if look_set_title is ON)
|
||||
- command name for /server can not contain spaces
|
||||
- when many WeeChat are launched, log file is not properly written (cleared by
|
||||
each WeeChat at startup)
|
||||
- WeeChat may crash if too much nicks in nicklist when position is top or bottom
|
||||
- when many WeeChat are launched, log file is not properly written
|
||||
(cleared by each WeeChat at startup)
|
||||
- WeeChat may crash if too much nicks in nicklist when position is top
|
||||
or bottom
|
||||
- ./configure does not check that Gtk 2.0 libraries are installed
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
@@ -1,9 +1,37 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2005-11-11
|
||||
ChangeLog - 2006-01-14
|
||||
|
||||
|
||||
Version 0.1.7 (2006-01-14):
|
||||
* fixed msg command (now allowed in private buffer with "*" as target)
|
||||
* removed "irc_default_msg_away" setting, for RFC 2812 conformity
|
||||
(/away command wihtout argument only removes away status),
|
||||
new values for "irc_display_away" (off, local, channel)
|
||||
* fixed refresh bug with Solaris when term size is changed
|
||||
* replaced Texinfo doc by XML Docbook
|
||||
* added color for window separators (when splited)
|
||||
* added completion system for plugins/scripts commands
|
||||
* fixed plugins autoload
|
||||
* added charset by server and channel, new command: /charset
|
||||
* added Ruby script plugin
|
||||
* added /upgrade command
|
||||
* added ETA (Estimated Time of Arrival) for DCC files
|
||||
* /nick command is now allowed when not connected to server
|
||||
* added server/channel arg to /buffer command for jumping to buffer
|
||||
* fixed display bug in chat window when a message length equals to window
|
||||
width
|
||||
* added new keys for switching to other windows: alt-w followed by
|
||||
alt-{arrow}
|
||||
* added new keys for scrolling to previous/next highlight: alt-P / alt-N
|
||||
* added "read marker": an indicator for first unread line in a
|
||||
server or channel buffer (new key alt-U to scroll to marker)
|
||||
* new window maganement: custom size for windows, auto resize when
|
||||
terminal is resized
|
||||
* fixed infinite loop when resizing term to small size
|
||||
* added /history command
|
||||
|
||||
Version 0.1.6 (2005-11-11):
|
||||
* new color management system, IRC colors are now correctly
|
||||
displayed and can be removed by new options irc_colors_receive
|
||||
@@ -19,7 +47,7 @@ Version 0.1.6 (2005-11-11):
|
||||
* full UTF-8 support, auto-detection of UTF-8 usage (locale)
|
||||
* added "Day changed to [date]" message when day changes
|
||||
* new plugin interface, rewritten from scratch: now loads dynamic C
|
||||
library, and perl/python are plugin scripts
|
||||
library, and perl/python are script plugins
|
||||
* log options (for server/channel/private) can now be set while
|
||||
WeeChat is running
|
||||
* added channel modes +e and +f
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-11-11
|
||||
WeeChat FAQ, 2006-01-14
|
||||
=======================
|
||||
|
||||
Intended audience:
|
||||
@@ -51,6 +51,7 @@ Q: Why using WeeChat ? X-Chat and Irssi are so good...
|
||||
A: Because WeeChat is very light and has new features.
|
||||
Some new features:
|
||||
* many GUI (Curses, Gtk, wxWidgets, Qt)
|
||||
* available in many languages
|
||||
* nicklist available in all GUI
|
||||
* extensible with scripts (Perl, Python, Ruby)
|
||||
* horizontal and vertical window split
|
||||
@@ -100,7 +101,6 @@ A: You can use /perl command to load scripts (default path is
|
||||
~/.weechat/perl).
|
||||
Note that scripts in ~/.weechat/perl/autoload are automatically loaded
|
||||
when WeeChat is starting up.
|
||||
WeeChat Perl scripts are 80% compatible with X-Chat, but not with Irssi.
|
||||
|
||||
|
||||
2.6
|
||||
@@ -112,14 +112,16 @@ A: You can use /python command to load scripts (default path is
|
||||
~/.weechat/python).
|
||||
Note that scripts in ~/.weechat/python/autoload are automatically loaded
|
||||
when WeeChat is starting up.
|
||||
WeeChat Python scripts are 80% compatible with X-Chat, but not with Irssi.
|
||||
|
||||
|
||||
2.7
|
||||
================================================================================
|
||||
Q: How can I load Ruby scripts?
|
||||
|
||||
A: Today Ruby interface is not developed, so you can't load any Ruby script.
|
||||
A: You can use /ruby command to load scripts (default path is
|
||||
~/.weechat/ruby).
|
||||
Note that scripts in ~/.weechat/ruby/autoload are automatically loaded
|
||||
when WeeChat is starting up.
|
||||
|
||||
|
||||
3.1
|
||||
@@ -164,13 +166,8 @@ A: There is 2 ways to submit your feature request:
|
||||
================================================================================
|
||||
Q: What is the list of supported platforms for WeeChat?
|
||||
|
||||
A: Today WeeChat was succesfully tested on these platforms:
|
||||
- GNU/Linux (any distribution / i386, AMD64, Sparc)
|
||||
- FreeBSD
|
||||
- NetBSD
|
||||
- OpenBSD
|
||||
- Mac OS X
|
||||
- Microsoft Windows (with Cygwin and some code changes)
|
||||
A: Full list is on this page:
|
||||
http://weechat.flashtux.org/download.php?lang=en&view=supported_os
|
||||
|
||||
|
||||
3.5
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-11-11
|
||||
WeeChat FAQ, 2006-01-14
|
||||
=======================
|
||||
|
||||
Public concerné :
|
||||
@@ -54,6 +54,7 @@ Q: Pourquoi utiliser WeeChat ? X-Chat et Irssi sont si bien...
|
||||
R: Parce que WeeChat est très léger et a de nouvelles fonctionnalités.
|
||||
Quelques nouvelles fonctionnalités :
|
||||
* plusieurs interfaces (Curses, Gtk, wxWidgets, Qt)
|
||||
* disponible en plusieurs langues
|
||||
* liste des pseudos disponible dans toutes les interfaces
|
||||
* extensible par des scripts (Perl, Python, Ruby)
|
||||
* découpage de la fenêtre horizontalement et verticalement
|
||||
@@ -105,7 +106,6 @@ R: La commande /perl permet de charger les scripts Perl (le chemin par d
|
||||
est ~/.weechat/perl).
|
||||
Notez que les scripts dans ~/.weechat/perl/autoload sont automatiquement
|
||||
chargés par WeeChat lorsqu'il démarre.
|
||||
Les scripts Perl WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
|
||||
|
||||
|
||||
2.6
|
||||
@@ -117,15 +117,16 @@ R: La commande /python permet de charger les scripts Python (le chemin par
|
||||
défaut est ~/.weechat/python).
|
||||
Notez que les scripts dans ~/.weechat/python/autoload sont automatiquement
|
||||
chargés par WeeChat lorsqu'il démarre.
|
||||
Les scripts Python WeeChat sont 80% compatibles avec X-Chat, mais pas Irssi.
|
||||
|
||||
|
||||
2.7
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Ruby ?
|
||||
|
||||
R: Aujourd'hui l'interface Ruby n'est pas développée.
|
||||
Vous ne pouvez donc charger aucun script Ruby.
|
||||
R: La commande /ruby permet de charger les scripts Ruby (le chemin par
|
||||
défaut est ~/.weechat/ruby).
|
||||
Notez que les scripts dans ~/.weechat/ruby/autoload sont automatiquement
|
||||
chargés par WeeChat lorsqu'il démarre.
|
||||
|
||||
|
||||
3.1
|
||||
@@ -175,13 +176,8 @@ R: Il y a 2 mani
|
||||
================================================================================
|
||||
Q: Quelle est la liste des plate-formes supportées par WeeChat ?
|
||||
|
||||
R: Aujourd'hui WeeChat a été testé avec succès sur ces plate-formes :
|
||||
- GNU/Linux (toute distribution / i386, AMD64, Sparc)
|
||||
- FreeBSD
|
||||
- NetBSD
|
||||
- OpenBSD
|
||||
- Mac OS X
|
||||
- Microsoft Windows (avec Cygwin et quelques modifications de code)
|
||||
R: La liste complète est sur cette page :
|
||||
http://weechat.flashtux.org/download.php?lang=fr&view=supported_os
|
||||
|
||||
|
||||
3.5
|
||||
|
||||
+5
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
SUBDIRS = po doc intl src
|
||||
@@ -22,7 +22,8 @@ EXTRA_DIST = config.rpath BUGS FAQ FAQ.fr \
|
||||
debian/copyright debian/compat \
|
||||
debian/rules debian/weechat-common.docs \
|
||||
debian/weechat-common.install debian/weechat-curses.dirs \
|
||||
debian/weechat-curses.install \
|
||||
weechat_icon_32.png
|
||||
debian/weechat-curses.install debian/weechat-plugins.install \
|
||||
debian/weechat-curses.menu debian/NEWS \
|
||||
weechat.spec weechat_icon_32.png
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
* FlashCode, 2006-01-14
|
||||
|
||||
WeeChat 0.1.7 released.
|
||||
|
||||
Important release notes:
|
||||
|
||||
- Ruby script plugin has been added but is experimental in this release.
|
||||
You're warned!
|
||||
|
||||
- "/away" command was changed to be RFC 2812 compliant.
|
||||
Now argument is required to set away, and no argument means
|
||||
remove away ("back"). Setting "irc_default_msg_away" has been removed.
|
||||
|
||||
* FlashCode, 2005-11-11
|
||||
|
||||
WeeChat 0.1.6 released.
|
||||
|
||||
@@ -22,7 +22,7 @@ Features
|
||||
Copyright
|
||||
---------
|
||||
|
||||
WeeChat (c) Copyright 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
WeeChat (c) Copyright 2003-2006 by FlashCode <flashcode@flashtux.org>
|
||||
(see AUTHORS file if you want to contact authors)
|
||||
|
||||
WeeChat is distributed under GPL licence (see COPYING file for complete license):
|
||||
@@ -39,7 +39,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
TODO - 2005-11-11
|
||||
TODO - 2006-01-14
|
||||
|
||||
Legend:
|
||||
# done
|
||||
@@ -16,14 +16,20 @@ Legend:
|
||||
|
||||
* Interface:
|
||||
+ Gtk GUI
|
||||
+ internationalization (traduce WeeChat in many languages)
|
||||
# highlight should not occur on partial words
|
||||
# one buffer for all servers
|
||||
- color for nicks (except own nick) when nick colors are disabled
|
||||
- allow decode/encode charsets for servers or chan (not globally)
|
||||
# interpret special chars in messages (color & bold for example)
|
||||
- understand incomplete commands if unambigous (for example: /he for /help is ok)
|
||||
? Qt GUI
|
||||
+ internationalization (traduce WeeChat in many languages)
|
||||
- add dark colors (demi intensity)
|
||||
# color for nicks (except own nick) when nick colors are disabled
|
||||
# allow decode/encode charsets for servers or chan (not globally)
|
||||
- understand incomplete commands if unambigous (for example: /he for /help is ok)
|
||||
- interpret 'old-school' special chars in messages: *bold* _underline_ /italic/
|
||||
- minimal width of nick in text area
|
||||
- display number of highlights since last buffer read (pink square)
|
||||
- add "*" on the side of message buffer when alt-j or other meta modifier is on
|
||||
- completion with tab key for all words starting with "#" by opened chans names
|
||||
- completion when input line is empty should add last nick that wrote to me
|
||||
- open new channels near server (not at the end of buffers)
|
||||
- add filename completion (for example with /dcc send)
|
||||
|
||||
* WeeChat commands
|
||||
- be able to bind a key on more than one command
|
||||
@@ -32,24 +38,56 @@ Legend:
|
||||
- "/completion" command: do shortcuts (for example when we type "u"
|
||||
in the text bar it send it to the server as "you")
|
||||
- "/last": command to look for text in previous messages
|
||||
- completion system for scripts arguments
|
||||
# "/uptime" command
|
||||
- "/upgrade" command: reload WeeChat himself without disconnecting from server
|
||||
# completion system for scripts arguments
|
||||
# "/upgrade" command: reload WeeChat himself without disconnecting from server
|
||||
- get help on config settings with /help option instead of /set option (since
|
||||
many options can be displayed and help is not displayed in this case)
|
||||
- "/cycle": do a /part then /join on current channel
|
||||
- be able to save the current buffer with a single command
|
||||
(/buffer dump /path/to/file), or to make it possible to write a script
|
||||
that does so (see plugins)
|
||||
- "/reconnect": reconnect to all servers, without waiting for auto-reconnect delay after disconnection
|
||||
|
||||
* IRC protocol:
|
||||
- customizable CTCP version reply
|
||||
# customizable CTCP version reply (possible by plugin script)
|
||||
- complete "/list" command: add regexp search, display only channels that
|
||||
match regexp
|
||||
- when we're away, WeeChat should log all the lines begenning by our nick.
|
||||
When we come back from our away it should print it to the current window
|
||||
- "/notify" and "/unnotify" command to be warn by WeeChat when a given
|
||||
nick/host connect to the given irc network
|
||||
- display one time away message of remote user in private (optional)
|
||||
- add max number of nicks for away check (do not check away nicks on channels with high number of nicks)
|
||||
- add anti-flood mechanism, when pasting more than N lines
|
||||
- add mask for /ban command, and ban types (host, nick)
|
||||
|
||||
* Configuration:
|
||||
- be able to launch more than one command when connecting to server
|
||||
- use ~/.weechat/dcc by default for DCC incoming files (and create
|
||||
directory at startup if not found)
|
||||
- add global username/realname, used if server values are not filled
|
||||
- add command line arg (--dir ?) to choose weechat home dir
|
||||
(~/.weechat by default)
|
||||
- be able to set more than one server address for network
|
||||
- save buffer numbers (order) to config file and restore them when
|
||||
opened, or make it possible by script
|
||||
|
||||
* Plugins:
|
||||
# dynamically load plugins as a separate library
|
||||
- allow print function to write on all buffers or all channels of a server
|
||||
- Ruby plugin
|
||||
- "/ruby load" and "/ruby unload" commands to (un)load Ruby scripts
|
||||
- add "outgoing" message event so scripts can edit user-input text before
|
||||
it is sent to the channel
|
||||
- add a timer function so scripts can do things like timeouts, delayed
|
||||
processing, etc.
|
||||
- allow print function to write on all buffers or all channels of a server
|
||||
- allow plugins to perform actions on "highlight" messages
|
||||
- get_servers(), get_channels(server), get_nicks(server,channel)
|
||||
- Lua plugin
|
||||
- Tcl plugin
|
||||
- Php plugin (maybe if possible)
|
||||
? "fish" plugin (cf http://fish.sekure.us/)
|
||||
- script plugins (perl, python, ruby, ..) should load scripts in system dir,
|
||||
not only ~/.weechat/xxxx/autoload/
|
||||
- allow plugins to get the contents of a specified (or at least the
|
||||
"current") buffer.
|
||||
|
||||
+36
-11
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,17 +12,17 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.56)
|
||||
AC_INIT(WeeChat, 0.1.6, flashcode@flashtux.org)
|
||||
AC_INIT(WeeChat, 0.1.7, flashcode@flashtux.org)
|
||||
AC_CONFIG_SRCDIR([src/common/weechat.c])
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE([weechat], [0.1.6])
|
||||
AM_INIT_AUTOMAKE([weechat], [0.1.7])
|
||||
|
||||
# Checks for programs
|
||||
AC_PROG_CC
|
||||
@@ -38,6 +38,9 @@ netbsd*)
|
||||
CFLAGS="$CFLAGS -I/usr/pkg/include"
|
||||
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
|
||||
;;
|
||||
solaris*)
|
||||
LDFLAGS="$LDFLAGS -lsocket -lxnet"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
@@ -100,7 +103,7 @@ AC_ARG_ENABLE(perl, [ --enable-perl Turn on Perl script plug
|
||||
AC_ARG_ENABLE(python, [ --enable-python Turn on Python script plugin (default=no Python plugin)],enable_python=$enableval,enable_python=no)
|
||||
AC_ARG_ENABLE(ruby, [ --enable-ruby Turn on Ruby script plugin (default=no Ruby script)],enable_ruby=$enableval,enable_ruby=no)
|
||||
AC_ARG_ENABLE(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=0)],debug=$withval,debug=0)
|
||||
AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1)
|
||||
|
||||
AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes")
|
||||
AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
|
||||
@@ -178,7 +181,7 @@ PLUGINS_LIBS=
|
||||
if test "x$enable_perl" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
|
||||
AC_PATH_PROG(PERL, perl perl5)
|
||||
AC_PATH_PROGS(PERL, perl perl5)
|
||||
if test -z $PERL ; then
|
||||
AC_MSG_ERROR([
|
||||
*** Perl must be installed on your system
|
||||
@@ -222,7 +225,7 @@ fi
|
||||
if test "x$enable_python" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
|
||||
AC_PATH_PROG(PYTHON, python python2.4 python2.3 python2.2)
|
||||
AC_PATH_PROGS(PYTHON, python python2.4 python2.3 python2.2)
|
||||
if test -z $PYTHON ; then
|
||||
AC_MSG_ERROR([
|
||||
*** Python must be installed on your system
|
||||
@@ -270,11 +273,31 @@ fi
|
||||
|
||||
if test "x$enable_ruby" = "xyes" ; then
|
||||
enable_plugins="yes"
|
||||
|
||||
AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby1.9)
|
||||
if test -z $RUBY ; then
|
||||
AC_MSG_ERROR([
|
||||
*** Ruby must be installed on your system
|
||||
*** but ruby interpreter couldn't be found in path.
|
||||
|
||||
*** Please check that ruby is in path, or install
|
||||
*** it with your software package manager.])
|
||||
fi
|
||||
|
||||
# TODO: check that ruby lib and headers are installed
|
||||
|
||||
RUBY_CFLAGS=-I`ruby -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
|
||||
RUBY_LFLAGS=`ruby -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
|
||||
RUBY_INCLUDE=`$RUBY -rrbconfig -e "puts Config::CONFIG[['archdir']]"`
|
||||
|
||||
AC_MSG_CHECKING(for Ruby header files)
|
||||
if test -r "$RUBY_INCLUDE/ruby.h"; then
|
||||
RUBY_CFLAGS="-I$RUBY_INCLUDE"
|
||||
else
|
||||
AC_MSG_ERROR([
|
||||
*** Ruby header files couldn't be found in your system.
|
||||
*** Try to install them with your software package manager.])
|
||||
fi
|
||||
AC_MSG_RESULT(found)
|
||||
|
||||
RUBY_LFLAGS=`$RUBY -rrbconfig -e "puts Config::CONFIG[['LIBRUBYARG_SHARED']]"`
|
||||
|
||||
AC_SUBST(RUBY_CFLAGS)
|
||||
AC_SUBST(RUBY_LFLAGS)
|
||||
AC_DEFINE(PLUGIN_RUBY)
|
||||
@@ -379,6 +402,8 @@ esac
|
||||
|
||||
AC_OUTPUT([Makefile
|
||||
doc/Makefile
|
||||
doc/fr/Makefile
|
||||
doc/en/Makefile
|
||||
src/Makefile
|
||||
src/common/Makefile
|
||||
src/irc/Makefile
|
||||
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
weechat (0.1.6-1) unstable; urgency=low
|
||||
|
||||
This release introduces some incompatible changes with old scripts and locale
|
||||
support, you can read the upstream NEWS file for more information.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Fri, 11 Nov 2005 20:45:46 +0100
|
||||
Vendored
+141
@@ -1,3 +1,144 @@
|
||||
weechat (0.1.6-2) unstable; urgency=low
|
||||
|
||||
* Apply path to fix segfault when removing server.
|
||||
* Move plugins in a separate package
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Tue, 22 Nov 2005 08:33:09 +0100
|
||||
|
||||
weechat (0.1.6-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
* Add menu entry
|
||||
* Move libperl5.8 and python2.3 from Depends to Recommends
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Fri, 11 Nov 2005 22:21:08 +0100
|
||||
|
||||
weechat (0.1.5-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sat, 24 Sep 2005 14:08:55 +0200
|
||||
|
||||
weechat (0.1.4-2) unstable; urgency=low
|
||||
|
||||
* Add autotools-dev to Build-Depends.
|
||||
* update autotools stuff automatically to always
|
||||
have up-to-date config.{guess,sub}
|
||||
* Update Build-Depends: libgnutls11-dev -> libgnutls-dev
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Mon, 1 Aug 2005 11:46:39 +0200
|
||||
|
||||
weechat (0.1.4-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sat, 30 Jul 2005 16:26:55 +0200
|
||||
|
||||
weechat (0.1.3-2) unstable; urgency=low
|
||||
|
||||
* Update config.{guess,sub} to fix FTBFS on k*BSD (Closes: #316791)
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Fri, 8 Jul 2005 21:30:38 +0200
|
||||
|
||||
weechat (0.1.3-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sat, 2 Jul 2005 20:06:29 +0200
|
||||
|
||||
weechat (0.1.2-3) unstable; urgency=low
|
||||
|
||||
* Apply patch against gui-display.c to fix curses color bug.
|
||||
* remove dh_install --sourcedir to allow builds on woody.
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Sun, 19 Jun 2005 22:37:11 +0200
|
||||
|
||||
weechat (0.1.2-2) unstable; urgency=low
|
||||
|
||||
* Patch src/gui/curse/gui-display.c to fix segfault
|
||||
when config file does not exists (Closes: #310589).
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Tue, 24 May 2005 20:55:02 +0200
|
||||
|
||||
weechat (0.1.2-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.1.2, see ChangeLog for detail.
|
||||
|
||||
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 21 May 2005 08:00:00 +0200
|
||||
|
||||
weechat (0.1.1-2) unstable; urgency=low
|
||||
|
||||
* debian/control:
|
||||
- Add myself to uploaders.
|
||||
- Remove unecessary dependency on weechat-gtk (Closes: #308287).
|
||||
|
||||
-- Julien Louis <ptitlouis@sysif.net> Tue, 10 May 2005 22:38:52 +0200
|
||||
|
||||
weechat (0.1.1-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.1.1, see ChangeLog for detail (closes: #306492)
|
||||
|
||||
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 20 Mar 2005 08:00:00 +0200
|
||||
|
||||
weechat (0.1.0-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.1.0, see ChangeLog for detail.
|
||||
|
||||
-- Sebastien Helleu <flashcode@flashtux.org> Sat, 12 Feb 2005 12:00:00 +0200
|
||||
|
||||
weechat (0.0.9-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.9, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 01 Jan 2005 13:00:00 +0200
|
||||
|
||||
weechat (0.0.8-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.8, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 30 Oct 2004 11:40:00 +0200
|
||||
|
||||
weechat (0.0.7-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.7, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 08 Aug 2004 21:00:00 +0200
|
||||
|
||||
weechat (0.0.6-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.6, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 05 Jun 2004 11:30:00 +0200
|
||||
|
||||
weechat (0.0.5-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.5, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 07 Feb 2004 20:30:00 +0200
|
||||
|
||||
weechat (0.0.4-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.4, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Thu, 01 Jan 2004 13:00:00 +0200
|
||||
|
||||
weechat (0.0.3-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.3, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Mon, 03 Nov 2003 23:15:00 +0200
|
||||
|
||||
weechat (0.0.2-1) unstable; urgency=low
|
||||
|
||||
* WeeChat version 0.0.2, see ChangeLog for detail.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sun, 05 Oct 2003 12:00:00 +0200
|
||||
|
||||
weechat (0.0.1-1) unstable; urgency=low
|
||||
|
||||
* First version.
|
||||
|
||||
-- FlashCode <flashcode@flashtux.org> Sat, 27 Sep 2003 12:00:00 +0200
|
||||
weechat (0.1.5-1) unstable; urgency=low
|
||||
|
||||
* New upstream release
|
||||
|
||||
Vendored
+10
-2
@@ -3,8 +3,8 @@ Section: net
|
||||
Priority: optional
|
||||
Maintainer: Sebastien Helleu <flashcode@flashtux.org>
|
||||
Uploaders: Julien Louis <ptitlouis@sysif.net>
|
||||
Build-Depends: debhelper (>> 4.0.0), libncursesw5-dev (>= 5.2.20020112a-7), libperl-dev, python-dev, libgnutls-dev, libtool, texinfo
|
||||
Standards-Version: 3.6.2.1
|
||||
Build-Depends: debhelper (>> 4.0.0), libncursesw5-dev (>= 5.2.20020112a-7), ruby1.8-dev, libperl-dev, python-dev, libgnutls-dev, libtool, texinfo
|
||||
Standards-Version: 3.6.2
|
||||
|
||||
Package: weechat
|
||||
Architecture: all
|
||||
@@ -26,6 +26,7 @@ Description: Fast, light and extensible IRC client
|
||||
Package: weechat-curses
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, weechat-common (= ${Source-Version})
|
||||
Recommends: weechat-plugins (= ${Source-Version})
|
||||
Description: Fast, light and extensible IRC client
|
||||
WeeChat (Wee Enhanced Environment for Chat) is a fast and light IRC client
|
||||
for many operating systems. Everything can be done with a keyboard.
|
||||
@@ -47,3 +48,10 @@ Recommends: weechat-curses
|
||||
Description: Common files for WeeChat
|
||||
Documentation, examples, and locale files for WeeChat - fast, light and
|
||||
extensible IRC client. It is useless without weechat-curses.
|
||||
|
||||
Package: weechat-plugins
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}
|
||||
Description: Plugins for WeeChat
|
||||
This package provides some plugins to enhance weechat with scripting languages
|
||||
such as perl python or ruby.
|
||||
|
||||
Vendored
+17
-14
@@ -15,7 +15,8 @@ configure: configure-stamp
|
||||
configure-stamp:
|
||||
dh_testdir
|
||||
./configure --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man \
|
||||
--infodir=\$${prefix}/share/info --enable-perl --enable-python
|
||||
--infodir=\$${prefix}/share/info --enable-perl --enable-python --enable-ruby \
|
||||
--with-debug=0
|
||||
touch configure-stamp
|
||||
|
||||
|
||||
@@ -42,6 +43,7 @@ install: build
|
||||
dh_install
|
||||
# install -o root -g root -m 755 src/gui/curses/weechat-curses $(CURDIR)/debian/weechat-curses/usr/bin
|
||||
# install -o root -g root -m 755 src/gui/gtk/weechat-gtk $(CURDIR)/debian/weechat-gtk/usr/bin
|
||||
install -D -o root -g root -m 644 weechat_icon_32.png $(CURDIR)/debian/weechat-common/usr/share/pixmaps/weechat_icon_32.png
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
@@ -63,20 +65,21 @@ binary-indep: build install
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch: build install
|
||||
dh_testdir -a
|
||||
dh_testroot -a
|
||||
# dh_installchangelogs -a
|
||||
# dh_installdocs -a
|
||||
dh_testdir -a -pweechat-curses -pweechat-plugins
|
||||
dh_testroot -a -pweechat-curses -pweechat-plugins
|
||||
dh_installchangelogs ChangeLog -pweechat-plugins
|
||||
dh_installdocs -pweechat-plugins
|
||||
dh_installman doc/weechat-curses.1 -pweechat-curses
|
||||
dh_link -a usr/share/doc/weechat-common usr/share/doc/weechat-curses
|
||||
dh_strip -a
|
||||
dh_compress -a
|
||||
dh_fixperms -a
|
||||
dh_installdeb -a
|
||||
dh_shlibdeps -a
|
||||
dh_gencontrol -a
|
||||
dh_md5sums -a
|
||||
dh_builddeb -a
|
||||
dh_link -pweechat-curses usr/share/doc/weechat-common usr/share/doc/weechat-curses
|
||||
dh_installmenu -pweechat-curses
|
||||
dh_strip -a -pweechat-curses -pweechat-plugins --exclude=libperl.a
|
||||
dh_compress -a -pweechat-curses -p weechat-plugins
|
||||
dh_fixperms -a -pweechat-curses -pweechat-plugins
|
||||
dh_installdeb -a -pweechat-curses -pweechat-plugins
|
||||
dh_shlibdeps -a -pweechat-curses -pweechat-plugins
|
||||
dh_gencontrol -a -pweechat-curses -pweechat-plugins
|
||||
dh_md5sums -a -pweechat-curses -pweechat-plugins
|
||||
dh_builddeb -a -pweechat-curses -pweechat-plugins
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
|
||||
Vendored
-1
@@ -1,2 +1 @@
|
||||
debian/tmp/usr/bin/weechat-curses
|
||||
debian/tmp/usr/lib/weechat
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
usr/share/doc/weechat-common usr/share/doc/weechat-curses
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
?package(weechat-curses):needs="text" section="Apps/Net" \
|
||||
title="weechat-curses" \
|
||||
icon="/usr/share/pixmaps/weechat_icon_32.png" \
|
||||
command="/usr/bin/weechat-curses"
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
usr/lib
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
debian/tmp/usr/lib
|
||||
+5
-11
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,17 +12,11 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
SUBDIRS = fr en
|
||||
|
||||
man_MANS = weechat-curses.1
|
||||
|
||||
info_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
#weechat_TEXINFOS = weechat_doc_fr.texi weechat_doc_en.texi \
|
||||
# weechat_doc_es.texi weechat_doc_pt.texi
|
||||
|
||||
AM_MAKEINFOHTMLFLAGS = --no-split --number-sections
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
EXTRA_DIST = $(man_MANS) weechat-doc.css weechat-html-one.xsl weechat-html.xsl
|
||||
|
||||
Executable
+169
@@ -0,0 +1,169 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# Build some XML code for WeeChat doc
|
||||
# with weechat-curses command
|
||||
#
|
||||
|
||||
@all_lang = ("fr_FR", "en_US");
|
||||
%all_encodings = ("fr_FR" => "iso-8859-1",
|
||||
"en_US" => "iso-8859-1");
|
||||
%all_types = ("fr_FR" => "type",
|
||||
"en_US" => "type",
|
||||
"es_ES" => "tipo");
|
||||
%all_values = ("fr_FR" => "valeurs",
|
||||
"en_US" => "values",
|
||||
"es_ES" => "valores");
|
||||
%all_default = ("fr_FR" => "valeur par défaut",
|
||||
"en_US" => "default values",
|
||||
"es_ES" => "valor por defecto");
|
||||
%all_desc = ("fr_FR" => "description",
|
||||
"en_US" => "description",
|
||||
"es_ES" => "descripciĂłn");
|
||||
|
||||
foreach $lng (@all_lang)
|
||||
{
|
||||
create_commands ($lng, $all_encodings{$lng},
|
||||
"weechat-curses -w | tail +3", "weechat_commands");
|
||||
create_commands ($lng, $all_encodings{$lng},
|
||||
"weechat-curses -i | tail +3", "irc_commands");
|
||||
create_key_func ($lng, $all_encodings{$lng},
|
||||
"weechat-curses -f | tail +3", "key_functions");
|
||||
create_config ($lng, $all_encodings{$lng},
|
||||
"weechat-curses -c | tail +3", "config");
|
||||
print "\n";
|
||||
}
|
||||
|
||||
sub create_commands
|
||||
{
|
||||
$lang = $_[0];
|
||||
$lang2 = substr ($lang, 0, 2);
|
||||
$encoding = $_[1];
|
||||
$command = $_[2];
|
||||
$file = $_[3];
|
||||
print "Creating $lang2/$file.xml ($lang)...\n";
|
||||
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
|
||||
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
|
||||
|
||||
$started = 0;
|
||||
$ENV{"LANG"} = $lang;
|
||||
foreach (`$command`)
|
||||
{
|
||||
if (/\* (.*)/)
|
||||
{
|
||||
print XML "</programlisting>\n" if ($started == 1);
|
||||
$started = 1;
|
||||
print XML "<command>$1</command>\n";
|
||||
print XML "<programlisting>";
|
||||
}
|
||||
else
|
||||
{
|
||||
chomp ($_);
|
||||
print XML "$_\n";
|
||||
}
|
||||
}
|
||||
print XML "</programlisting>\n";
|
||||
close XML;
|
||||
iconv_file ($lang2."/".$file, $encoding);
|
||||
}
|
||||
|
||||
sub create_key_func
|
||||
{
|
||||
$lang = $_[0];
|
||||
$lang2 = substr ($lang, 0, 2);
|
||||
$encoding = $_[1];
|
||||
$command = $_[2];
|
||||
$file = $_[3];
|
||||
print "Creating $lang2/$file.xml ($lang)...\n";
|
||||
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
|
||||
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
|
||||
|
||||
$ENV{"LANG"} = $lang;
|
||||
foreach (`$command`)
|
||||
{
|
||||
if (/\* (.*): (.*)/)
|
||||
{
|
||||
print XML "<row>\n";
|
||||
print XML " <entry><literal>$1</literal></entry>\n";
|
||||
print XML " <entry>$2</entry>\n";
|
||||
print XML "</row>\n";
|
||||
}
|
||||
}
|
||||
close XML;
|
||||
iconv_file ($lang2."/".$file, $encoding);
|
||||
}
|
||||
|
||||
sub create_config
|
||||
{
|
||||
$lang = $_[0];
|
||||
$lang2 = substr ($lang, 0, 2);
|
||||
$encoding = $_[1];
|
||||
$command = $_[2];
|
||||
$file = $_[3];
|
||||
print "Creating $lang2/$file.xml ($lang)...\n";
|
||||
open XML, ">$lang2/$file.xml" or die "Error: can't write file!";
|
||||
print XML "<?xml version=\"1.0\" encoding=\"$encoding\"?>\n";
|
||||
$type = "";
|
||||
$values = "";
|
||||
$default = "";
|
||||
$desc = "";
|
||||
|
||||
$ENV{"LANG"} = $lang;
|
||||
foreach (`weechat-curses -c`)
|
||||
{
|
||||
if (/\* (.*):/)
|
||||
{
|
||||
print XML "<row>\n";
|
||||
print XML " <entry><option>$1</option></entry>\n";
|
||||
}
|
||||
elsif (/ \. $all_types{$lang}: (.*)/)
|
||||
{
|
||||
$type = $1;
|
||||
}
|
||||
elsif (/ \. $all_values{$lang}: (.*)/)
|
||||
{
|
||||
$values = $1;
|
||||
}
|
||||
elsif (/ \. $all_default{$lang}: (.*)/)
|
||||
{
|
||||
$default = $1;
|
||||
}
|
||||
elsif (/ \. $all_desc{$lang}: (.*)/)
|
||||
{
|
||||
$_ = $1;
|
||||
s/(.*)/\u$1/;
|
||||
$desc = $_;
|
||||
print XML " <entry>".$type."</entry>\n";
|
||||
print XML " <entry>".$values."</entry>\n";
|
||||
print XML " <entry>".$default."</entry>\n";
|
||||
print XML " <entry>".$desc."</entry>\n";
|
||||
print XML "</row>\n";
|
||||
}
|
||||
}
|
||||
close XML;
|
||||
iconv_file ($lang2."/".$file, $encoding);
|
||||
}
|
||||
|
||||
sub iconv_file
|
||||
{
|
||||
print "Converting $_[0].xml to $_[1]...\n";
|
||||
system ("iconv -t $encoding -o $_[0].xml.$_[1] $_[0].xml");
|
||||
system ("mv $_[0].xml.$_[1] $_[0].xml");
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
# 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 = en
|
||||
BOOK = weechat.$(LANGCODE)
|
||||
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
|
||||
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE)
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
all-local: html-stamp
|
||||
|
||||
# HTML output with chunks (many pages)
|
||||
|
||||
html: html-stamp
|
||||
|
||||
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
|
||||
mkdir -p html/
|
||||
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html/
|
||||
touch html-stamp
|
||||
|
||||
# HTML output, all in one page
|
||||
|
||||
html1: html1-stamp
|
||||
|
||||
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
|
||||
mkdir -p html1/
|
||||
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html1/
|
||||
touch html1-stamp
|
||||
|
||||
# install docs
|
||||
|
||||
install-data-hook:
|
||||
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
|
||||
# clean
|
||||
|
||||
clean-local:
|
||||
-rm -f *.html *.pdf *.txt
|
||||
-rm -rf html/ html1/
|
||||
-rm -f html-stamp html1-stamp
|
||||
+1142
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,438 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<command>admin [target]</command>
|
||||
<programlisting>
|
||||
find information about the administrator of the server
|
||||
|
||||
target: server
|
||||
|
||||
</programlisting>
|
||||
<command>ame message</command>
|
||||
<programlisting>
|
||||
send a CTCP action to all channels of all connected servers
|
||||
|
||||
message: message to send
|
||||
|
||||
</programlisting>
|
||||
<command>amsg text</command>
|
||||
<programlisting>
|
||||
send message to all channels of all connected servers
|
||||
|
||||
text: text to send
|
||||
|
||||
</programlisting>
|
||||
<command>away [-all] [message]</command>
|
||||
<programlisting>
|
||||
toggle away status
|
||||
|
||||
-all: toggle away status on all connected servers
|
||||
message: message for away (if no message is given, away status is removed)
|
||||
|
||||
</programlisting>
|
||||
<command>ban [channel] [nickname [nickname ...]]</command>
|
||||
<programlisting>
|
||||
bans nicks or hosts
|
||||
|
||||
channel: channel for ban
|
||||
nickname: user or host to ban
|
||||
|
||||
</programlisting>
|
||||
<command>ctcp nickname type [arguments]</command>
|
||||
<programlisting>
|
||||
send a CTCP message (Client-To-Client Protocol)
|
||||
|
||||
nickname: user to send CTCP to
|
||||
type: CTCP type (examples: "version", "ping", ..)
|
||||
arguments: arguments for CTCP
|
||||
|
||||
</programlisting>
|
||||
<command>dcc action [nickname [file]]</command>
|
||||
<programlisting>
|
||||
starts DCC (file or chat) or close chat
|
||||
|
||||
action: 'send' (file) or 'chat' or 'close' (chat)
|
||||
nickname: nickname to send file or chat
|
||||
file: filename (on local host)
|
||||
|
||||
</programlisting>
|
||||
<command>dehalfop [nickname [nickname]]</command>
|
||||
<programlisting>
|
||||
removes half channel operator status from nickname(s)
|
||||
|
||||
</programlisting>
|
||||
<command>deop [nickname [nickname]]</command>
|
||||
<programlisting>
|
||||
removes channel operator status from nickname(s)
|
||||
|
||||
</programlisting>
|
||||
<command>devoice [nickname [nickname]]</command>
|
||||
<programlisting>
|
||||
removes voice from nickname(s)
|
||||
|
||||
</programlisting>
|
||||
<command>die</command>
|
||||
<programlisting>
|
||||
shutdown the server
|
||||
|
||||
</programlisting>
|
||||
<command>halfop [nickname [nickname]]</command>
|
||||
<programlisting>
|
||||
gives half channel operator status to nickname(s)
|
||||
|
||||
</programlisting>
|
||||
<command>info [target]</command>
|
||||
<programlisting>
|
||||
get information describing the server
|
||||
|
||||
target: server name
|
||||
|
||||
</programlisting>
|
||||
<command>invite nickname channel</command>
|
||||
<programlisting>
|
||||
invite a nick on a channel
|
||||
|
||||
nickname: nick to invite
|
||||
channel: channel to invite
|
||||
|
||||
</programlisting>
|
||||
<command>ison nickname [nickname ...]</command>
|
||||
<programlisting>
|
||||
check if a nickname is currently on IRC
|
||||
|
||||
nickname: nickname
|
||||
|
||||
</programlisting>
|
||||
<command>join channel[,channel] [key[,key]]</command>
|
||||
<programlisting>
|
||||
join a channel
|
||||
|
||||
channel: channel name to join
|
||||
key: key to join the channel
|
||||
|
||||
</programlisting>
|
||||
<command>kick [channel] nickname [comment]</command>
|
||||
<programlisting>
|
||||
forcibly remove a user from a channel
|
||||
|
||||
channel: channel where user is
|
||||
nickname: nickname to kick
|
||||
comment: comment for kick
|
||||
|
||||
</programlisting>
|
||||
<command>kickban [channel] nickname [comment]</command>
|
||||
<programlisting>
|
||||
kicks and bans a nick from a channel
|
||||
|
||||
channel: channel where user is
|
||||
nickname: nickname to kick and ban
|
||||
comment: comment for kick
|
||||
|
||||
</programlisting>
|
||||
<command>kill nickname comment</command>
|
||||
<programlisting>
|
||||
close client-server connection
|
||||
|
||||
nickname: nickname
|
||||
comment: comment for kill
|
||||
|
||||
</programlisting>
|
||||
<command>links [[server] server_mask]</command>
|
||||
<programlisting>
|
||||
list all servernames which are known by the server answering the query
|
||||
|
||||
server: this server should answer the query
|
||||
server_mask: list of servers must match this mask
|
||||
|
||||
</programlisting>
|
||||
<command>list [channel[,channel] [server]]</command>
|
||||
<programlisting>
|
||||
list channels and their topic
|
||||
|
||||
channel: channel to list
|
||||
server: server name
|
||||
|
||||
</programlisting>
|
||||
<command>lusers [mask [target]]</command>
|
||||
<programlisting>
|
||||
get statistics about the size of the IRC network
|
||||
|
||||
mask: servers matching the mask only
|
||||
target: server for forwarding request
|
||||
|
||||
</programlisting>
|
||||
<command>me message</command>
|
||||
<programlisting>
|
||||
send a CTCP action to the current channel
|
||||
|
||||
message: message to send
|
||||
|
||||
</programlisting>
|
||||
<command>mode { channel {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask] } | { nickname {[+|-]|i|w|s|o} }</command>
|
||||
<programlisting>
|
||||
change channel or user mode
|
||||
|
||||
channel modes:
|
||||
channel: channel name to modify
|
||||
o: give/take channel operator privileges
|
||||
p: private channel flag
|
||||
s: secret channel flag
|
||||
i: invite-only channel flag
|
||||
t: topic settable by channel operator only flag
|
||||
n: no messages to channel from clients on the outside
|
||||
m: moderated channel
|
||||
l: set the user limit to channel
|
||||
b: set a ban mask to keep users out
|
||||
e: set exception mask
|
||||
v: give/take the ability to speak on a moderated channel
|
||||
k: set a channel key (password)
|
||||
user modes:
|
||||
nickname: nickname to modify
|
||||
i: mark a user as invisible
|
||||
s: mark a user for receive server notices
|
||||
w: user receives wallops
|
||||
o: operator flag
|
||||
|
||||
</programlisting>
|
||||
<command>motd [target]</command>
|
||||
<programlisting>
|
||||
get the "Message Of The Day"
|
||||
|
||||
target: server name
|
||||
|
||||
</programlisting>
|
||||
<command>msg receiver[,receiver] text</command>
|
||||
<programlisting>
|
||||
send message to a nick or channel
|
||||
|
||||
receiver: nick or channel (may be mask, '*' = current channel)
|
||||
text: text to send
|
||||
|
||||
</programlisting>
|
||||
<command>names [channel[,channel]]</command>
|
||||
<programlisting>
|
||||
list nicknames on channels
|
||||
|
||||
channel: channel name
|
||||
|
||||
</programlisting>
|
||||
<command>nick [-all] nickname</command>
|
||||
<programlisting>
|
||||
change current nickname
|
||||
|
||||
-all: set new nickname for all connected servers
|
||||
nickname: new nickname
|
||||
|
||||
</programlisting>
|
||||
<command>notice nickname text</command>
|
||||
<programlisting>
|
||||
send notice message to user
|
||||
|
||||
nickname: user to send notice to
|
||||
text: text to send
|
||||
|
||||
</programlisting>
|
||||
<command>op nickname [nickname]</command>
|
||||
<programlisting>
|
||||
gives channel operator status to nickname(s)
|
||||
|
||||
</programlisting>
|
||||
<command>oper user password</command>
|
||||
<programlisting>
|
||||
get operator privileges
|
||||
|
||||
user/password: used to get privileges on current IRC server
|
||||
|
||||
</programlisting>
|
||||
<command>part [channel[,channel]] [part_message]</command>
|
||||
<programlisting>
|
||||
leave a channel
|
||||
|
||||
channel: channel name to leave
|
||||
part_message: part message (displayed to other users)
|
||||
|
||||
</programlisting>
|
||||
<command>ping server1 [server2]</command>
|
||||
<programlisting>
|
||||
ping server
|
||||
|
||||
server1: server to ping
|
||||
server2: forward ping to this server
|
||||
|
||||
</programlisting>
|
||||
<command>pong daemon [daemon2]</command>
|
||||
<programlisting>
|
||||
answer to a ping message
|
||||
|
||||
daemon: daemon who has responded to Ping message
|
||||
daemon2: forward message to this daemon
|
||||
|
||||
</programlisting>
|
||||
<command>query nickname [text]</command>
|
||||
<programlisting>
|
||||
send a private message to a nick
|
||||
|
||||
nickname: nickname for private conversation
|
||||
text: text to send
|
||||
|
||||
</programlisting>
|
||||
<command>quit [quit_message]</command>
|
||||
<programlisting>
|
||||
close all connections and quit
|
||||
|
||||
quit_message: quit message (displayed to other users)
|
||||
|
||||
</programlisting>
|
||||
<command>quote data</command>
|
||||
<programlisting>
|
||||
send raw data to server without parsing
|
||||
|
||||
data: raw data to send
|
||||
|
||||
</programlisting>
|
||||
<command>rehash</command>
|
||||
<programlisting>
|
||||
tell the server to reload its config file
|
||||
|
||||
</programlisting>
|
||||
<command>restart</command>
|
||||
<programlisting>
|
||||
tell the server to restart itself
|
||||
|
||||
</programlisting>
|
||||
<command>service nickname reserved distribution type reserved info</command>
|
||||
<programlisting>
|
||||
register a new service
|
||||
|
||||
distribution: visibility of service
|
||||
type: reserved for future usage
|
||||
|
||||
</programlisting>
|
||||
<command>servlist [mask [type]]</command>
|
||||
<programlisting>
|
||||
list services currently connected to the network
|
||||
|
||||
mask: list only services matching this mask
|
||||
type: list only services of this type
|
||||
|
||||
</programlisting>
|
||||
<command>squery service text</command>
|
||||
<programlisting>
|
||||
deliver a message to a service
|
||||
|
||||
service: name of service
|
||||
text: text to send
|
||||
|
||||
</programlisting>
|
||||
<command>squit server comment</command>
|
||||
<programlisting>
|
||||
disconnect server links
|
||||
|
||||
server: server name
|
||||
comment: comment for quit
|
||||
|
||||
</programlisting>
|
||||
<command>stats [query [server]]</command>
|
||||
<programlisting>
|
||||
query statistics about server
|
||||
|
||||
query: c/h/i/k/l/m/o/y/u (see RFC1459)
|
||||
server: server name
|
||||
|
||||
</programlisting>
|
||||
<command>summon user [target [channel]]</command>
|
||||
<programlisting>
|
||||
give users who are on a host running an IRC server a message asking them to please join IRC
|
||||
|
||||
user: username
|
||||
target: server name
|
||||
channel: channel name
|
||||
|
||||
</programlisting>
|
||||
<command>time [target]</command>
|
||||
<programlisting>
|
||||
query local time from server
|
||||
|
||||
target: query time from specified server
|
||||
|
||||
</programlisting>
|
||||
<command>topic [channel] [topic]</command>
|
||||
<programlisting>
|
||||
get/set channel topic
|
||||
|
||||
channel: channel name
|
||||
topic: new topic for channel (if topic is "-delete" then topic is deleted)
|
||||
|
||||
</programlisting>
|
||||
<command>trace [target]</command>
|
||||
<programlisting>
|
||||
find the route to specific server
|
||||
|
||||
target: server
|
||||
|
||||
</programlisting>
|
||||
<command>unban [channel] nickname [nickname ...]</command>
|
||||
<programlisting>
|
||||
unbans nicks or hosts
|
||||
|
||||
channel: channel for unban
|
||||
nickname: user or host to unban
|
||||
|
||||
</programlisting>
|
||||
<command>userhost nickname [nickname ...]</command>
|
||||
<programlisting>
|
||||
return a list of information about nicknames
|
||||
|
||||
nickname: nickname
|
||||
|
||||
</programlisting>
|
||||
<command>users [target]</command>
|
||||
<programlisting>
|
||||
list of users logged into the server
|
||||
|
||||
target: server
|
||||
|
||||
</programlisting>
|
||||
<command>version [server | nickname]</command>
|
||||
<programlisting>
|
||||
gives the version info of nick or server (current or specified)
|
||||
|
||||
server: server name
|
||||
nickname: nickname
|
||||
|
||||
</programlisting>
|
||||
<command>voice [nickname [nickname]]</command>
|
||||
<programlisting>
|
||||
gives voice to nickname(s)
|
||||
|
||||
</programlisting>
|
||||
<command>wallops text</command>
|
||||
<programlisting>
|
||||
send a message to all currently connected users who have set the 'w' user mode for themselves
|
||||
|
||||
text to send
|
||||
|
||||
</programlisting>
|
||||
<command>who [mask ["o"]]</command>
|
||||
<programlisting>
|
||||
generate a query which returns a list of information
|
||||
|
||||
mask: only information which match this mask
|
||||
o: only operators are returned according to the mask supplied
|
||||
|
||||
</programlisting>
|
||||
<command>whois [server] nickname[,nickname]</command>
|
||||
<programlisting>
|
||||
query information about user(s)
|
||||
|
||||
server: server name
|
||||
nickname: nickname (may be a mask)
|
||||
|
||||
</programlisting>
|
||||
<command>whowas nickname [,nickname [,nickname ...]] [count [target]]</command>
|
||||
<programlisting>
|
||||
ask for information about a nickname which no longer exists
|
||||
|
||||
nickname: nickname to search
|
||||
count: number of replies to return (full search if negative number)
|
||||
target: reply should match this mask
|
||||
|
||||
</programlisting>
|
||||
@@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<row>
|
||||
<entry><literal>return</literal></entry>
|
||||
<entry>terminate line</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>tab</literal></entry>
|
||||
<entry>complete word</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>backspace</literal></entry>
|
||||
<entry>delete previous char</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete</literal></entry>
|
||||
<entry>delete next char</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_end_line</literal></entry>
|
||||
<entry>delete until end of line</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_beginning_line</literal></entry>
|
||||
<entry>delete until beginning of line</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_line</literal></entry>
|
||||
<entry>delete entire line</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_previous_word</literal></entry>
|
||||
<entry>delete previous word</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_next_word</literal></entry>
|
||||
<entry>delete next word</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>clipboard_paste</literal></entry>
|
||||
<entry>paste current clipboard content</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>transpose_chars</literal></entry>
|
||||
<entry>transpose chars</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>home</literal></entry>
|
||||
<entry>go to beginning of line</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>end</literal></entry>
|
||||
<entry>go to end of line</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>left</literal></entry>
|
||||
<entry>move one char left</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>previous_word</literal></entry>
|
||||
<entry>move to previous word</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>right</literal></entry>
|
||||
<entry>move one char right</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>next_word</literal></entry>
|
||||
<entry>move to next word</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>up</literal></entry>
|
||||
<entry>call previous command in history</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>up_global</literal></entry>
|
||||
<entry>call previous command in global history</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>down</literal></entry>
|
||||
<entry>call next command in history</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>down_global</literal></entry>
|
||||
<entry>call next command in global history</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>page_up</literal></entry>
|
||||
<entry>scroll one page up</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>page_down</literal></entry>
|
||||
<entry>scroll one page down</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_beginning</literal></entry>
|
||||
<entry>display beginning of nicklist</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_end</literal></entry>
|
||||
<entry>display end of nicklist</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_page_up</literal></entry>
|
||||
<entry>scroll nicklist one page up</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_page_down</literal></entry>
|
||||
<entry>scroll nicklist one page down</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_smart</literal></entry>
|
||||
<entry>jump to buffer with activity</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_dcc</literal></entry>
|
||||
<entry>jump to DCC buffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_last_buffer</literal></entry>
|
||||
<entry>jump to last buffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_server</literal></entry>
|
||||
<entry>jump to server buffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_next_server</literal></entry>
|
||||
<entry>jump to next server</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>switch_server</literal></entry>
|
||||
<entry>switch active server on servers buffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_previous_highlight</literal></entry>
|
||||
<entry>scroll to previous highlight in buffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_next_highlight</literal></entry>
|
||||
<entry>scroll to next highlight in buffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_unread</literal></entry>
|
||||
<entry>scroll to first unread line in buffer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>hotlist_clear</literal></entry>
|
||||
<entry>clear hotlist</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>infobar_clear</literal></entry>
|
||||
<entry>clear infobar</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>refresh</literal></entry>
|
||||
<entry>refresh screen</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>grab_key</literal></entry>
|
||||
<entry>grab a key</entry>
|
||||
</row>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,197 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<command>alias [alias_name [command [arguments]]</command>
|
||||
<programlisting>
|
||||
create an alias for a command
|
||||
|
||||
alias_name: name of alias
|
||||
command: command name (WeeChat or IRC command, without first '/')
|
||||
arguments: arguments for command
|
||||
|
||||
</programlisting>
|
||||
<command>buffer [action | number | [[server] [channel]]]</command>
|
||||
<programlisting>
|
||||
manage buffers
|
||||
|
||||
action: action to do:
|
||||
move: move buffer in the list (may be relative, for example -1)
|
||||
close: close buffer (for channel: same as /part without part message)
|
||||
list: list opened buffers (no parameter implies this list)
|
||||
notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)
|
||||
server
|
||||
channel: jump to buffer by server and/or channel name
|
||||
number: jump to buffer by number
|
||||
|
||||
</programlisting>
|
||||
<command>charset [(decode_iso | decode_utf | encode) charset]</command>
|
||||
<programlisting>
|
||||
change charset for server or channel
|
||||
|
||||
decode_iso: charset used for decoding ISO
|
||||
decode_utf: charset used for decoding UTF
|
||||
encode: charset used for encoding messages
|
||||
charset: charset to use (for example: ISO-8859-15, UTF-8,..)
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all]</command>
|
||||
<programlisting>
|
||||
clear window(s)
|
||||
|
||||
-all: clear all windows
|
||||
|
||||
</programlisting>
|
||||
<command>connect [servername]</command>
|
||||
<programlisting>
|
||||
connect to a server
|
||||
|
||||
servername: server name to connect
|
||||
|
||||
</programlisting>
|
||||
<command>disconnect [servername]</command>
|
||||
<programlisting>
|
||||
disconnect from a server
|
||||
|
||||
servername: server name to disconnect
|
||||
|
||||
</programlisting>
|
||||
<command>debug dump | windows</command>
|
||||
<programlisting>
|
||||
print debug messages
|
||||
|
||||
dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)
|
||||
windows: display windows tree
|
||||
|
||||
</programlisting>
|
||||
<command>help [command]</command>
|
||||
<programlisting>
|
||||
display help about commands
|
||||
|
||||
command: name of a WeeChat or IRC command
|
||||
|
||||
</programlisting>
|
||||
<command>history [clear | value]</command>
|
||||
<programlisting>
|
||||
show buffer command history
|
||||
|
||||
clear: clear history
|
||||
value: number of history entries to show
|
||||
|
||||
</programlisting>
|
||||
<command>ignore [mask [[type | command] [channel [server]]]]</command>
|
||||
<programlisting>
|
||||
ignore IRC messages and/or hosts
|
||||
|
||||
mask: nick or host mask to ignore
|
||||
type: type of message to ignore (action, ctcp, dcc, pv)
|
||||
command: IRC command
|
||||
channel: name of channel for ignore
|
||||
server: name of server for ignore
|
||||
|
||||
For each argument, '*' means all.
|
||||
Without argument, /ignore command lists all defined ignore.
|
||||
|
||||
</programlisting>
|
||||
<command>key [key function/command] [unbind key] [functions] [reset -yes]</command>
|
||||
<programlisting>
|
||||
bind/unbind keys
|
||||
|
||||
key: bind this key to an internal function or a command (beginning by "/")
|
||||
unbind: unbind a key
|
||||
functions: list internal functions for key bindings
|
||||
reset: restore bindings to the default values and delete ALL personal bindings (use carefully!)
|
||||
|
||||
</programlisting>
|
||||
<command>plugin [load filename] | [autoload] | [reload] | [unload]</command>
|
||||
<programlisting>
|
||||
list/load/unload plugins
|
||||
|
||||
filename: WeeChat plugin (file) to load
|
||||
|
||||
Without argument, /plugin command lists all loaded plugins.
|
||||
|
||||
</programlisting>
|
||||
<command>server [servername] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]</command>
|
||||
<programlisting>
|
||||
list, add or remove servers
|
||||
|
||||
servername: server name, for internal and display use
|
||||
hostname: name or IP address of server
|
||||
port: port for server (integer)
|
||||
ipv6: use IPv6 protocol
|
||||
ssl: use SSL protocol
|
||||
password: password for server
|
||||
nick1: first nick for server
|
||||
nick2: alternate nick for server
|
||||
nick3: second alternate nick for server
|
||||
username: user name
|
||||
realname: real name of user
|
||||
|
||||
</programlisting>
|
||||
<command>save [file]</command>
|
||||
<programlisting>
|
||||
save config to disk
|
||||
|
||||
file: filename for writing config
|
||||
|
||||
</programlisting>
|
||||
<command>set [option [ = value]]</command>
|
||||
<programlisting>
|
||||
set config parameters
|
||||
|
||||
option: name of an option (if name is full and no value is given, then help is displayed on option)
|
||||
value: value for option
|
||||
|
||||
</programlisting>
|
||||
<command>unalias alias_name</command>
|
||||
<programlisting>
|
||||
remove an alias
|
||||
|
||||
alias_name: name of alias to remove
|
||||
|
||||
</programlisting>
|
||||
<command>unignore [number | [mask [[type | command] [channel [server]]]]]</command>
|
||||
<programlisting>
|
||||
unignore IRC messages and/or hosts
|
||||
|
||||
number: # of ignore to unignore (number is displayed by list of ignore)
|
||||
mask: nick or host mask to unignore
|
||||
type: type of message to unignore (action, ctcp, dcc, pv)
|
||||
command: IRC command
|
||||
channel: name of channel for unignore
|
||||
server: name of server for unignore
|
||||
|
||||
For each argument, '*' means all.
|
||||
Without argument, /unignore command lists all defined ignore.
|
||||
|
||||
</programlisting>
|
||||
<command>upgrade</command>
|
||||
<programlisting>
|
||||
upgrade WeeChat without disconnecting from servers
|
||||
|
||||
</programlisting>
|
||||
<command>uptime [-o]</command>
|
||||
<programlisting>
|
||||
show WeeChat uptime
|
||||
|
||||
-o: send uptime on current channel as an IRC message
|
||||
|
||||
</programlisting>
|
||||
<command>window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all]]</command>
|
||||
<programlisting>
|
||||
manage windows
|
||||
|
||||
list: list opened windows (no parameter implies this list)
|
||||
-1: jump to previous window
|
||||
+1: jump to next window
|
||||
b#: jump to next window displaying buffer number #
|
||||
up: switch to window above current one
|
||||
down: switch to window below current one
|
||||
left: switch to window on the left
|
||||
right: switch to window on the right
|
||||
splith: split current window horizontally
|
||||
splitv: split current window vertically
|
||||
resize: resize window size, new size is pct%% of parent window
|
||||
merge: merge window with another (all = keep only one window)
|
||||
|
||||
For splith and splitv, pct is a pourcentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4
|
||||
|
||||
</programlisting>
|
||||
@@ -0,0 +1,59 @@
|
||||
# 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 = fr
|
||||
BOOK = weechat.$(LANGCODE)
|
||||
BOOK_INCLUDE = weechat_commands.xml irc_commands.xml key_functions.xml config.xml
|
||||
|
||||
EXTRA_DIST = $(BOOK).xml $(BOOK_INCLUDE)
|
||||
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
all-local: html-stamp
|
||||
|
||||
# HTML output with chunks (many pages)
|
||||
|
||||
html: html-stamp
|
||||
|
||||
html-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html.xsl ../weechat-doc.css
|
||||
mkdir -p html/
|
||||
xsltproc -o html/ ../weechat-html.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html/
|
||||
touch html-stamp
|
||||
|
||||
# HTML output, all in one page
|
||||
|
||||
html1: html1-stamp
|
||||
|
||||
html1-stamp: $(BOOK).xml $(BOOK_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css
|
||||
mkdir -p html1/
|
||||
xsltproc -o html1/$(BOOK).html ../weechat-html-one.xsl $(BOOK).xml || true
|
||||
cp ../weechat-doc.css html1/
|
||||
touch html1-stamp
|
||||
|
||||
# install docs
|
||||
|
||||
install-data-hook:
|
||||
$(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
$(INSTALL_DATA) html/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/
|
||||
|
||||
# clean
|
||||
|
||||
clean-local:
|
||||
-rm -f *.html *.pdf *.txt
|
||||
-rm -rf html/ html1/
|
||||
-rm -f html-stamp html1-stamp
|
||||
+1142
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,438 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<command>admin [cible]</command>
|
||||
<programlisting>
|
||||
trouver les informations sur l'administrateur du serveur
|
||||
|
||||
cible: serveur
|
||||
|
||||
</programlisting>
|
||||
<command>ame message</command>
|
||||
<programlisting>
|
||||
envoyer une action CTCP à tous les canaux de tous les serveurs connectés
|
||||
|
||||
message: message Ă envoyer
|
||||
|
||||
</programlisting>
|
||||
<command>amsg texte</command>
|
||||
<programlisting>
|
||||
envoyer un message à tous les canaux de tous les serveurs connectés
|
||||
|
||||
texte: texte Ă envoyer
|
||||
|
||||
</programlisting>
|
||||
<command>away [-all] [message]</command>
|
||||
<programlisting>
|
||||
basculer le statut absent
|
||||
|
||||
-all: basculer le statut absent sur tous les serveurs connectés
|
||||
message: message pour l'absence (si pas de message donné, le statut d'absence est supprimé)
|
||||
|
||||
</programlisting>
|
||||
<command>ban [canal] [pseudo [pseudo ...]]</command>
|
||||
<programlisting>
|
||||
bannit des pseudos ou masques
|
||||
|
||||
canal: nom du canal pour le bannissement
|
||||
pseudo: pseudo ou masque pour le bannissement
|
||||
|
||||
</programlisting>
|
||||
<command>ctcp pseudo type [arguments]</command>
|
||||
<programlisting>
|
||||
envoyer un message CTCP (Client-To-Client Protocol)
|
||||
|
||||
pseudo: utilisateur Ă qui envoyer le CTCP
|
||||
type: type de CTCP (exemples: "version", "ping", etc...)
|
||||
arguments: arguments pour le CTCP
|
||||
|
||||
</programlisting>
|
||||
<command>dcc action [pseudo [fichier]]</command>
|
||||
<programlisting>
|
||||
démarre le DCC (fichier ou discussion) ou ferme une discussion
|
||||
|
||||
action: 'send' (envoi de fichier) ou 'chat' (discussion) ou 'close' (fermeture discussion)
|
||||
pseudo: pseudo pour envoyer le fichier ou discuter
|
||||
fichier: nom du fichier (sur la machine locale)
|
||||
|
||||
</programlisting>
|
||||
<command>dehalfop [pseudo [pseudo]]</command>
|
||||
<programlisting>
|
||||
retire le statut de demi-opérateur du canal à /aux nick(s)
|
||||
|
||||
</programlisting>
|
||||
<command>deop [pseudo [pseudo]]</command>
|
||||
<programlisting>
|
||||
retire le statut d'opérateur du canal à /aux nick(s)
|
||||
|
||||
</programlisting>
|
||||
<command>devoice [pseudo [pseudo]]</command>
|
||||
<programlisting>
|
||||
retire la voix du/des pseudo(s)
|
||||
|
||||
</programlisting>
|
||||
<command>die</command>
|
||||
<programlisting>
|
||||
arrĂŞter le serveur
|
||||
|
||||
</programlisting>
|
||||
<command>halfop [pseudo [pseudo]]</command>
|
||||
<programlisting>
|
||||
donner le statut de demi-opérateur à un/des utilisateur(s)
|
||||
|
||||
</programlisting>
|
||||
<command>info [cible]</command>
|
||||
<programlisting>
|
||||
voir les informations décrivant le serveur
|
||||
|
||||
cible: nom du serveur
|
||||
|
||||
</programlisting>
|
||||
<command>invite pseudo canal</command>
|
||||
<programlisting>
|
||||
inviter un utilisateur sur un canal
|
||||
|
||||
pseudo: utilisateur Ă inviter
|
||||
channel: canal pour l'invitation
|
||||
|
||||
</programlisting>
|
||||
<command>ison pseudo [pseudo ...]</command>
|
||||
<programlisting>
|
||||
vérifier si un utilisateur est actuellement sur IRC
|
||||
|
||||
pseudo: pseudo
|
||||
|
||||
</programlisting>
|
||||
<command>join canal[,canal] [clé[,clé]]</command>
|
||||
<programlisting>
|
||||
joindre un canal
|
||||
|
||||
canal: nom du canal Ă rejoindre
|
||||
clé: clé pour rejoindre le canal
|
||||
|
||||
</programlisting>
|
||||
<command>kick [canal] pseudo [commentaire]</command>
|
||||
<programlisting>
|
||||
retirer par la force un utilisateur d'un canal
|
||||
|
||||
canal: canal oĂą l'utilisateur se trouve
|
||||
pseudo: utilisateur à éliminer
|
||||
commentaire: commentaire pour l'élimination
|
||||
|
||||
</programlisting>
|
||||
<command>kickban [canal] pseudo [commentaire]</command>
|
||||
<programlisting>
|
||||
retirer par la force un utilisateur d'un canal et le bannir
|
||||
|
||||
canal: canal oĂą l'utilisateur se trouve
|
||||
pseudo: utilisateur à éliminer et bannir
|
||||
commentaire: commentaire pour l'élimination
|
||||
|
||||
</programlisting>
|
||||
<command>kill pseudo commentaire</command>
|
||||
<programlisting>
|
||||
fermer la connexion client-serveur
|
||||
|
||||
pseudo: utilisateur
|
||||
commentaire: commentaire pour la mort
|
||||
|
||||
</programlisting>
|
||||
<command>links [[serveur] masque_serveur]</command>
|
||||
<programlisting>
|
||||
lister tous les noms de serveurs connus du serveur qui répondent à la requête
|
||||
|
||||
serveur: ce serveur doit répondre à la requête
|
||||
masque_serveur: liste des serveurs correspondant au masque
|
||||
|
||||
</programlisting>
|
||||
<command>list [canal[,canall] [serveur]]</command>
|
||||
<programlisting>
|
||||
lister les canaux et leur sujet
|
||||
|
||||
canal: canal Ă lister
|
||||
serveur: nom du serveur
|
||||
|
||||
</programlisting>
|
||||
<command>lusers [masque [cible]]</command>
|
||||
<programlisting>
|
||||
obtenir des statistiques sur la taille du réseau IRC
|
||||
|
||||
masque: serveurs qui correspondent au masque seulement
|
||||
cible: serveur pour faire suivre la requĂŞte
|
||||
|
||||
</programlisting>
|
||||
<command>me message</command>
|
||||
<programlisting>
|
||||
envoyer une action CTCP au canal courant
|
||||
|
||||
message: message Ă envoyer
|
||||
|
||||
</programlisting>
|
||||
<command>mode { canal {[+|-]|o|p|s|i|t|n|b|v} [limite] [utilisateur] [masque de banissement] } | { nick {[+|-]|i|w|s|o} }</command>
|
||||
<programlisting>
|
||||
changer le mode du canal ou de l'utilisateur
|
||||
|
||||
modes de canaux :
|
||||
canal: nom du canal Ă modifier
|
||||
o: donner/reprendre le statut privilégié d'opérateur
|
||||
p: indicateur de canal privé
|
||||
s: indicateur de canal secret
|
||||
i: indicateur de canal avec invitation seulement
|
||||
t: le titre est modifiable seulement par un opérateur du canal
|
||||
n: aucun message au canal depuis l'extérieur
|
||||
m: canal modéré
|
||||
l: fixer la limite d'utilisateurs pour le canal
|
||||
b: paramétrer un masque de banissement pour garder des utilisateurs dehors
|
||||
e: paramétrer un masque d'exception
|
||||
v: donner/reprendre la possibilité de parler sur un canal modéré
|
||||
k: définir une clé (mot de passe) pour accéder au canal
|
||||
modes utilisateur :
|
||||
pseudo: utilisateur Ă modifier
|
||||
i: marquer un utilisateur comme invisible
|
||||
s: marquer un utilisateur pour recevoir les notices du serveur
|
||||
w: l'utilisateur reçoit les wallops
|
||||
o: drapeau opérateur
|
||||
|
||||
</programlisting>
|
||||
<command>motd [cible]</command>
|
||||
<programlisting>
|
||||
obtenir le message du jour
|
||||
|
||||
cible: nom du serveur
|
||||
|
||||
</programlisting>
|
||||
<command>msg cible[,cible] texte</command>
|
||||
<programlisting>
|
||||
envoyer un message Ă un utilisateur ou canal
|
||||
|
||||
cible: utilisateur ou canal (peut-ĂŞtre un masque, '*' = canal courant)
|
||||
texte: texte Ă envoyer
|
||||
|
||||
</programlisting>
|
||||
<command>names [canal[,canal]]</command>
|
||||
<programlisting>
|
||||
lister les utilisateurs sur des canaux
|
||||
|
||||
canal: nom du canal
|
||||
|
||||
</programlisting>
|
||||
<command>nick [-all] pseudo</command>
|
||||
<programlisting>
|
||||
changer le pseudo courant
|
||||
|
||||
-all: définir le nouveau pseudo sur tous les serveurs connectés
|
||||
pseudo: nouveau pseudo
|
||||
|
||||
</programlisting>
|
||||
<command>notice pseudo texte</command>
|
||||
<programlisting>
|
||||
envoyer un message notice Ă un utilisateur
|
||||
|
||||
pseudo: utilisateur cible pour la notice
|
||||
texte: texte Ă envoyer
|
||||
|
||||
</programlisting>
|
||||
<command>op pseudo [pseudo]</command>
|
||||
<programlisting>
|
||||
donner le statut opérateur à un/des utilisateur(s)
|
||||
|
||||
</programlisting>
|
||||
<command>oper utilisateur mot_de_passe</command>
|
||||
<programlisting>
|
||||
obtenir le statut d'opérateur
|
||||
|
||||
utilisateur/mot_de_passe: utilisé pour obtenir les privilèges sur le serveur IRC courant
|
||||
|
||||
</programlisting>
|
||||
<command>part [canal[,canall] [message_de_fin]</command>
|
||||
<programlisting>
|
||||
quitter un canal
|
||||
|
||||
canal: canal Ă quitter
|
||||
message_de_fin: message de fin (affiché aux autres utilisateurs)
|
||||
|
||||
</programlisting>
|
||||
<command>ping serveur1 [serveur2]</command>
|
||||
<programlisting>
|
||||
pinguer un serveur
|
||||
|
||||
serveur1: serveur Ă pinguer
|
||||
serveur2: faire suivre le ping Ă ce serveur
|
||||
|
||||
</programlisting>
|
||||
<command>pong démon [démon2]</command>
|
||||
<programlisting>
|
||||
répondre à un message ping
|
||||
|
||||
démon: démon qui a répondu au message Ping
|
||||
démon2: faire suivre le message à ce démon
|
||||
|
||||
</programlisting>
|
||||
<command>query pseudo [texte]</command>
|
||||
<programlisting>
|
||||
envoyer un message privé à un utilisateur
|
||||
|
||||
pseudo: utilisateur pour la conversation privée
|
||||
texte: texte Ă envoyer
|
||||
|
||||
</programlisting>
|
||||
<command>quit [message_de_fin]</command>
|
||||
<programlisting>
|
||||
fermer toutes les connexions et quitter
|
||||
|
||||
message_de_fin: message de fin (affiché aux autres utilisateurs)
|
||||
|
||||
</programlisting>
|
||||
<command>quote données</command>
|
||||
<programlisting>
|
||||
envoyer des données brutes au serveur sans analyse
|
||||
|
||||
données: données brutes à envoyer
|
||||
|
||||
</programlisting>
|
||||
<command>rehash</command>
|
||||
<programlisting>
|
||||
demander au serveur de recharger son fichier de configuration
|
||||
|
||||
</programlisting>
|
||||
<command>restart</command>
|
||||
<programlisting>
|
||||
demander au serveur de redémarrer
|
||||
|
||||
</programlisting>
|
||||
<command>service pseudo réservé distribution type réservé info</command>
|
||||
<programlisting>
|
||||
enregister un nouveau service
|
||||
|
||||
distribution: visibilité du service
|
||||
type: réservé pour une utilisation future
|
||||
|
||||
</programlisting>
|
||||
<command>servlist [masque [type]]</command>
|
||||
<programlisting>
|
||||
lister les services actuellement connectés au réseau
|
||||
|
||||
masque: lister seulement les services qui correspondent Ă ce masque
|
||||
type: lister seulement les services de ce type
|
||||
|
||||
</programlisting>
|
||||
<command>squery service texte</command>
|
||||
<programlisting>
|
||||
envoyer un message Ă un service
|
||||
|
||||
service: nom du service
|
||||
texte: texte Ă envoyer
|
||||
|
||||
</programlisting>
|
||||
<command>squit serveur commentaire</command>
|
||||
<programlisting>
|
||||
déconnecter les liens vers un serveur
|
||||
|
||||
serveur: nom du serveur
|
||||
commentaire: commentaire pour quitter
|
||||
|
||||
</programlisting>
|
||||
<command>stats [requĂŞte [serveur]]</command>
|
||||
<programlisting>
|
||||
demander des statistiques sur le serveur
|
||||
|
||||
requĂŞte: c/h/i/k/l/m/o/y/u (voir la RFC1459)
|
||||
serveur: nom du serveur
|
||||
|
||||
</programlisting>
|
||||
<command>summon utilisateur [cible [canal]]</command>
|
||||
<programlisting>
|
||||
envoyer aux utilisateurs d'un serveur IRC un message leur demandant de rejoindre IRC
|
||||
|
||||
utilisateur: nom d'utilisateur
|
||||
cible: nom du serveur
|
||||
canal: nom du canal
|
||||
|
||||
</programlisting>
|
||||
<command>time [cible]</command>
|
||||
<programlisting>
|
||||
demander l'heure locale de serveur
|
||||
|
||||
cible: demander l'heure de ce serveur
|
||||
|
||||
</programlisting>
|
||||
<command>topic [canal] [titre]</command>
|
||||
<programlisting>
|
||||
recevoir/définir le titre du canal
|
||||
|
||||
canal: nom du canal
|
||||
titre: nouveau titre pour le canal (si le titre est "-delete" alors le titre est supprimé)
|
||||
|
||||
</programlisting>
|
||||
<command>trace [cible]</command>
|
||||
<programlisting>
|
||||
trouver le chemin jusqu'à un serveur spécifique
|
||||
|
||||
cible: serveur
|
||||
|
||||
</programlisting>
|
||||
<command>unban [canal] pseudo [pseudo ...]</command>
|
||||
<programlisting>
|
||||
supprime le bannissement sur des pseudos ou masques
|
||||
|
||||
canal: nom du canal pour supprimer le bannissement
|
||||
pseudo: pseudo ou masque pour supprimer le bannissement
|
||||
|
||||
</programlisting>
|
||||
<command>userhost pseudo [pseudo ...]</command>
|
||||
<programlisting>
|
||||
retourne une liste d'informations sur des utilisateurs
|
||||
|
||||
pseudo: pseudo
|
||||
|
||||
</programlisting>
|
||||
<command>users [cible]</command>
|
||||
<programlisting>
|
||||
liste des utilisateurs connectés au serveur
|
||||
|
||||
cible: serveur
|
||||
|
||||
</programlisting>
|
||||
<command>version [serveur | pseudo]</command>
|
||||
<programlisting>
|
||||
retourne la version de l'utilisateur ou du serveur (courant ou spécifié)
|
||||
|
||||
serveur: nom du serveur
|
||||
pseudo: utilisateur
|
||||
|
||||
</programlisting>
|
||||
<command>voice [pseudo [pseudo]]</command>
|
||||
<programlisting>
|
||||
donne la voix Ă /aux utilisateur(s)
|
||||
|
||||
</programlisting>
|
||||
<command>wallops texte</command>
|
||||
<programlisting>
|
||||
envoyer un message à tous les utilisateurs connectés qui ont activé le mode utilisateur 'w' pour eux-mêmes
|
||||
|
||||
texte Ă envoyer
|
||||
|
||||
</programlisting>
|
||||
<command>who [masque ["o"]]</command>
|
||||
<programlisting>
|
||||
génère une requête qui retourne une liste d'information
|
||||
|
||||
masque: information qui correspond Ă ce masque uniquement
|
||||
o: seul les opérateurs sont retournés correspondant au masque fourni
|
||||
|
||||
</programlisting>
|
||||
<command>whois [serveur] pseudo[,pseudo]</command>
|
||||
<programlisting>
|
||||
demande les informations sur le(s) utilisateur(s)
|
||||
|
||||
serveur: nom du serveur
|
||||
pseudo: utilisateur (peut ĂŞtre un masque)
|
||||
|
||||
</programlisting>
|
||||
<command>whowas pseudo [,pseudo [,pseudo ...]] [nombre [cible]]</command>
|
||||
<programlisting>
|
||||
demander de l'information sur un nick qui n'existe plus
|
||||
|
||||
pseudo: pseudo Ă chercher
|
||||
nombre: nombre de réponses à retourner (recherche complète si nombre négatif)
|
||||
cible: la réponse doit correspondre à ce masque
|
||||
|
||||
</programlisting>
|
||||
@@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<row>
|
||||
<entry><literal>return</literal></entry>
|
||||
<entry>terminer la ligne</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>tab</literal></entry>
|
||||
<entry>compléter le mot</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>backspace</literal></entry>
|
||||
<entry>effacer le caractère précédent</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete</literal></entry>
|
||||
<entry>effacer le caractère suivant</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_end_line</literal></entry>
|
||||
<entry>effacer jusqu'Ă la fin de la ligne</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_beginning_line</literal></entry>
|
||||
<entry>effacer jusqu'au début de la ligne</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_line</literal></entry>
|
||||
<entry>effacer la ligne entière</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_previous_word</literal></entry>
|
||||
<entry>effacer le mot précédent</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>delete_next_word</literal></entry>
|
||||
<entry>effacer le mot suivant</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>clipboard_paste</literal></entry>
|
||||
<entry>coller le contenu du presse-papier</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>transpose_chars</literal></entry>
|
||||
<entry>inverser les caractères</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>home</literal></entry>
|
||||
<entry>aller au début de la ligne</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>end</literal></entry>
|
||||
<entry>aller Ă la fin de la ligne</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>left</literal></entry>
|
||||
<entry>se déplacer d'un caractère à gauche</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>previous_word</literal></entry>
|
||||
<entry>se déplacer au mot précédent</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>right</literal></entry>
|
||||
<entry>se déplacer d'un caractère à droite</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>next_word</literal></entry>
|
||||
<entry>se déplacer au mot suivant</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>up</literal></entry>
|
||||
<entry>appeler la commande précédente dans l'historique</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>up_global</literal></entry>
|
||||
<entry>appeler la commande précédente dans l'historique global</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>down</literal></entry>
|
||||
<entry>appeler la commande suivante dans l'historique</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>down_global</literal></entry>
|
||||
<entry>appeler la commande suivante dans l'historique global</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>page_up</literal></entry>
|
||||
<entry>faire défiler d'une page vers le haut</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>page_down</literal></entry>
|
||||
<entry>faire défiler d'une page vers le bas</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_beginning</literal></entry>
|
||||
<entry>afficher le début de la liste des pseudos</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_end</literal></entry>
|
||||
<entry>afficher la fin de la liste des pseudos</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_page_up</literal></entry>
|
||||
<entry>faire défiler la liste des pseudos d'une page vers le haut</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>nick_page_down</literal></entry>
|
||||
<entry>faire défiler la liste des pseudos d'une page vers le bas</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_smart</literal></entry>
|
||||
<entry>sauter au tampon avec de l'activité</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_dcc</literal></entry>
|
||||
<entry>sauter au tampon DCC</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_last_buffer</literal></entry>
|
||||
<entry>sauter au dernier tampon</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_server</literal></entry>
|
||||
<entry>sauter au tampon du serveur</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>jump_next_server</literal></entry>
|
||||
<entry>sauter au prochain serveur</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>switch_server</literal></entry>
|
||||
<entry>bascule de serveur actif sur le tampon des serveurs</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_previous_highlight</literal></entry>
|
||||
<entry>scroller jusqu'au highlight précédent du tampon</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_next_highlight</literal></entry>
|
||||
<entry>scroller jusqu'au highlight suivant du tampon</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>scroll_unread</literal></entry>
|
||||
<entry>scroller jusqu'à la première ligne non lue du tampon</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>hotlist_clear</literal></entry>
|
||||
<entry>effacer la liste d'activité</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>infobar_clear</literal></entry>
|
||||
<entry>effacer la barre d'infos</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>refresh</literal></entry>
|
||||
<entry>rafraîchir l'écran</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>grab_key</literal></entry>
|
||||
<entry>capturer une touche</entry>
|
||||
</row>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,197 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<command>alias [nom_alias [commande [paramètres]]</command>
|
||||
<programlisting>
|
||||
créer un alias pour une commande
|
||||
|
||||
nom_alias: nom de l'alias
|
||||
commande: nom de la commande (commande WeeChat ou IRC, sans le premier '/')
|
||||
paramètres: paramètres pour la commande
|
||||
|
||||
</programlisting>
|
||||
<command>buffer [action | nombre | [[serveur] [canal]]]</command>
|
||||
<programlisting>
|
||||
gestion des tampons
|
||||
|
||||
action: action Ă effectuer:
|
||||
move: déplacer le tampon dans la liste (peut être relatif, par exemple -1)
|
||||
close: fermer le tampon (pour un canal: équivalent à /part sans message de fin)
|
||||
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)
|
||||
serveur
|
||||
canal: sauter au tampon par serveur et/ou nom de canal
|
||||
nombre: sauter au tampon qui a ce numéro
|
||||
|
||||
</programlisting>
|
||||
<command>charset [(decode_iso | decode_utf | encode) charset]</command>
|
||||
<programlisting>
|
||||
changer le jeu de caractères pour le serveur ou le canal
|
||||
|
||||
decode_iso: jeu de caractères utilisé pour décoder l'ISO
|
||||
decode_utf: jeu de caractères utilisé pour décoder l'UTF
|
||||
encode: jeu de caractères utilisé pour encoder les messages
|
||||
charset: jeu de caractères à utiliser (par exemple: ISO-8859-15, UTF-8,..)
|
||||
|
||||
</programlisting>
|
||||
<command>clear [-all]</command>
|
||||
<programlisting>
|
||||
effacer la/les fenĂŞtre(s)
|
||||
|
||||
-all: effacer toutes les fenĂŞtres
|
||||
|
||||
</programlisting>
|
||||
<command>connect [nom_serveur]</command>
|
||||
<programlisting>
|
||||
se connecter Ă un serveur
|
||||
|
||||
nom_serveur: nom du serveur pour se connecter
|
||||
|
||||
</programlisting>
|
||||
<command>disconnect [nom_serveur]</command>
|
||||
<programlisting>
|
||||
se déconnecter d'un serveur
|
||||
|
||||
nom_serveur: nom du serveur pour se déconnecter
|
||||
|
||||
</programlisting>
|
||||
<command>debug dump | windows</command>
|
||||
<programlisting>
|
||||
affiche des messages de debogage
|
||||
|
||||
dump: affiche les variables mémoire WeeChat dans le fichier log (les mêmes messages sont affichés lorsque WeeChat plante)
|
||||
windows: affiche l'arbre des fenĂŞtres
|
||||
|
||||
</programlisting>
|
||||
<command>help [commande]</command>
|
||||
<programlisting>
|
||||
afficher l'aide sur les commandes
|
||||
|
||||
commande: nom d'une commande WeeChat ou IRC
|
||||
|
||||
</programlisting>
|
||||
<command>history [clear | valeur]</command>
|
||||
<programlisting>
|
||||
affiche l'historique des commandes du tampon
|
||||
|
||||
clear: effacer l'historique
|
||||
valeur: nombre d'entrées dans l'historique à afficher
|
||||
|
||||
</programlisting>
|
||||
<command>ignore [masque [[type | commande] [canal [serveur]]]]</command>
|
||||
<programlisting>
|
||||
ignorer des messages IRC et/ou des masques
|
||||
|
||||
masque: pseudo ou masque Ă ignorer
|
||||
type: type de message Ă ignorer (action, ctcp, dcc, pv)
|
||||
commande: commande IRC
|
||||
canal: nom du canal pour le ignore
|
||||
serveur: nom du serveur pour le ignore
|
||||
|
||||
Pour chaque paramètre, '*' signifie tou(te)s.
|
||||
Sans paramètres, la commande /ignore liste les ignore définis.
|
||||
|
||||
</programlisting>
|
||||
<command>key [touche fonction/commande] [unbind touche] [functions] [reset -yes]</command>
|
||||
<programlisting>
|
||||
associer/libérer des touches
|
||||
|
||||
touche: associer cette touche à une fonction interne ou une commande (commençant par "/")
|
||||
unbind: supprimer l'association Ă une touche
|
||||
functions: lister la liste des fonctions internes pour les associations de touches
|
||||
reset: restaure les touches aux valeurs par défaut et supprime TOUTES les touches personnelles (utiliser avec précaution !)
|
||||
|
||||
</programlisting>
|
||||
<command>plugin [load fichier] | [autoload] | [reload] | [unload]</command>
|
||||
<programlisting>
|
||||
liste/charge/décharge des extensions
|
||||
|
||||
fichier: extension WeeChat (fichier) Ă charger
|
||||
|
||||
Sans paramètre, la commande /plugin liste toutes les extensions chargées.
|
||||
|
||||
</programlisting>
|
||||
<command>server [nom_serveur] | [nom_serveur nom/IP port [-auto | -noauto] [-ipv6] [-ssl] [-pwd mot_de_passe] [-nicks pseudo1 pseudo2 pseudo3] [-username nom_utilisateur] [-realname nom_réel] [-command commande] [-autojoin canal[,canal]] ] | [del nom_serveur]</command>
|
||||
<programlisting>
|
||||
liste, ajoute ou retire des serveurs
|
||||
|
||||
nom_serveur: nom du serveur, pour usage interne et affichage
|
||||
nom/IP: nom ou adresse IP du serveur
|
||||
port: port pour le serveur (nombre entier)
|
||||
ipv6: utiliser le protocole IPv6
|
||||
ssl: utiliser le protocole SSL
|
||||
mot_de_passe: mot de passe pour le serveur
|
||||
pseudo1: premier pseudo pour le serveur
|
||||
pseudo2: pseudo alternatif pour le serveur
|
||||
pseudo3: second pseudo alternatif pour le serveur
|
||||
nom_utilisateur: nom d'utilisateur
|
||||
nom_réel: nom réel de l'utilisateur
|
||||
|
||||
</programlisting>
|
||||
<command>save [fichier]</command>
|
||||
<programlisting>
|
||||
sauvegarder la configuration sur disque
|
||||
|
||||
fichier: fichier pour sauvegarder la configuration
|
||||
|
||||
</programlisting>
|
||||
<command>set [option [ = valeur]]</command>
|
||||
<programlisting>
|
||||
modifier des paramètres de configuration
|
||||
|
||||
option: nom de l'option (si le nom est complet et qu'aucune valeur n'est donnée, alors l'aide sur l'option est affichée)
|
||||
valeur: valeur pour l'option
|
||||
|
||||
</programlisting>
|
||||
<command>unalias nom_alias</command>
|
||||
<programlisting>
|
||||
supprimer un alias
|
||||
|
||||
nom_alias: nom de l'alias Ă supprimer
|
||||
|
||||
</programlisting>
|
||||
<command>unignore [nombre | [masque [[type | commande] [canal [serveur]]]]]</command>
|
||||
<programlisting>
|
||||
supprimer le ignore des messages IRC et/ou des masques
|
||||
|
||||
nombre: numéro de ignore à supprimer (le nombre est affiché sur la liste des ignore)
|
||||
masque: pseudo ou masque Ă ignorer
|
||||
type: type de message Ă ignorer (action, ctcp, dcc, pv)
|
||||
commande: commande IRC
|
||||
canal: nom du canal pour le ignore
|
||||
serveur: nom du serveur pour le ignore
|
||||
|
||||
Pour chaque paramètre, '*' signifie tou(te)s.
|
||||
Sans paramètre, /ignore liste les ignore définis.
|
||||
|
||||
</programlisting>
|
||||
<command>upgrade</command>
|
||||
<programlisting>
|
||||
mettre à jour WeeChat sans se déconnecter des serveurs
|
||||
|
||||
</programlisting>
|
||||
<command>uptime [-o]</command>
|
||||
<programlisting>
|
||||
montrer l'uptime de WeeChat
|
||||
|
||||
-o: envoyer l'uptime sur le canal courant en tant que message IRC
|
||||
|
||||
</programlisting>
|
||||
<command>window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [ptc] | resize pct | merge [all]]</command>
|
||||
<programlisting>
|
||||
gestion des fenĂŞtres
|
||||
|
||||
list: liste les fenêtres ouvertes (pas de paramètre affiche cette liste)
|
||||
-1: saute à la fenêtre précédente
|
||||
+1: saute Ă la fenĂŞtre suivante
|
||||
b#: saute à la fenêtre affichant le tampon n°#
|
||||
up: saute Ă la fenĂŞtre au dessus
|
||||
down: saute Ă la fenĂŞtre au dessous
|
||||
left: saute Ă la fenĂŞtre Ă gauche
|
||||
right: saute Ă la fenĂŞtre Ă droite
|
||||
splith: éclate la fenêtre en deux horizontalement
|
||||
splitv: éclate la fenêtre en deux verticalement
|
||||
resize: redimensionne une fenĂŞtre, la nouvelle taille est pct%% de la fenĂŞtre parent
|
||||
merge: fusionne la fenĂŞtre avec une autre
|
||||
|
||||
Pour splith et splitv, pct est un pourcentage qui représente la taille de la nouvelle fenêtre, calculée par rapport à la taille de la fenêtre courante. Par exemple 25 signifie créer une fenêtre qui a pour taille: taille_courante / 4
|
||||
|
||||
</programlisting>
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH WEECHAT 1 "November 2005" "FlashCode"
|
||||
.TH WEECHAT 1 "January 2006" "FlashCode"
|
||||
|
||||
.SH NAME
|
||||
weechat-curses \- Wee Enhanced Environment for Chat (Curses version)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* WeeChat doc CSS
|
||||
* (c) 2006 by FlashCode <flashcode@flashtux.org>
|
||||
*/
|
||||
|
||||
body {
|
||||
font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
table {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.informaltable table {
|
||||
font-size: 11px;
|
||||
font-family: Verdana;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.informaltable table th {
|
||||
padding: 2px 5px 2px 5px;
|
||||
border: solid 1px #AAAAAA;
|
||||
background-color: #DDDDFF;
|
||||
}
|
||||
|
||||
.informaltable table td {
|
||||
padding: 2px 5px 2px 5px;
|
||||
border: solid 1px #AAAAAA;
|
||||
}
|
||||
|
||||
.oddrow {
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
|
||||
.synopsis {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.programlisting {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
pre.screen {
|
||||
font-size: 11px;
|
||||
background-color: #F5F5F5;
|
||||
border: solid 1px #CCCCCC;
|
||||
padding: 4px;
|
||||
margin: 0 40px 0 40px;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:import href="/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl"/>
|
||||
|
||||
<xsl:output indent="yes"/>
|
||||
|
||||
<xsl:param name="chunk.section.depth" select="2"/>
|
||||
<xsl:param name="chunk.quietly" select="1"/>
|
||||
<xsl:param name="chunk.first.sections" select="1"/>
|
||||
<xsl:param name="generate.section.toc.level" select="3"/>
|
||||
|
||||
<xsl:param name="html.stylesheet">weechat-doc.css</xsl:param>
|
||||
|
||||
<xsl:template name="tr.attributes">
|
||||
<xsl:param name="row" select="."/>
|
||||
<xsl:param name="rownum" select="0"/>
|
||||
|
||||
<xsl:if test="not(ancestor::table/@tabstyle = 'unstriped')">
|
||||
<xsl:if test="$rownum mod 2 = 0">
|
||||
<xsl:attribute name="class">oddrow</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<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:output indent="yes"/>
|
||||
|
||||
<xsl:param name="chunk.section.depth" select="2"/>
|
||||
<xsl:param name="chunk.quietly" select="1"/>
|
||||
<xsl:param name="chunk.first.sections" select="1"/>
|
||||
<xsl:param name="generate.section.toc.level" select="3"/>
|
||||
|
||||
<xsl:param name="html.stylesheet">weechat-doc.css</xsl:param>
|
||||
|
||||
<xsl:template name="tr.attributes">
|
||||
<xsl:param name="row" select="."/>
|
||||
<xsl:param name="rownum" select="0"/>
|
||||
|
||||
<xsl:if test="not(ancestor::table/@tabstyle = 'unstriped')">
|
||||
<xsl:if test="$rownum mod 2 = 0">
|
||||
<xsl:attribute name="class">oddrow</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,8 @@
|
||||
./src/common/hotlist.h
|
||||
./src/common/log.c
|
||||
./src/common/log.h
|
||||
./src/common/session.c
|
||||
./src/common/session.h
|
||||
./src/common/utf8.c
|
||||
./src/common/utf8.h
|
||||
./src/common/weechat.c
|
||||
|
||||
+1670
-1128
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
SUBDIRS = common irc plugins gui
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GNUTLS_CFLAGS)
|
||||
@@ -37,5 +37,7 @@ lib_weechat_main_a_SOURCES = weechat.c \
|
||||
log.h \
|
||||
fifo.c \
|
||||
fifo.h \
|
||||
session.c \
|
||||
session.h \
|
||||
utf8.c \
|
||||
utf8.h
|
||||
|
||||
+750
-188
File diff suppressed because it is too large
Load Diff
+35
-28
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
@@ -31,13 +31,17 @@ typedef struct t_weechat_command t_weechat_command;
|
||||
|
||||
struct t_weechat_command
|
||||
{
|
||||
char *command_name;
|
||||
char *command_description;
|
||||
char *arguments;
|
||||
char *arguments_description;
|
||||
int min_arg, max_arg;
|
||||
int (*cmd_function_args)(int, char **);
|
||||
int (*cmd_function_1arg)(char *);
|
||||
char *command_name; /* WeeChat (internal) command name */
|
||||
char *command_description; /* command description (for /help) */
|
||||
char *arguments; /* command arguments (for /help) */
|
||||
char *arguments_description; /* arguments description (for /help) */
|
||||
char *completion_template; /* template for completion */
|
||||
/* NULL=no completion, ""=default (nick) */
|
||||
int min_arg, max_arg; /* min & max number of arguments */
|
||||
int (*cmd_function_args)(t_gui_window *, int, char **);
|
||||
/* function called when user enters cmd */
|
||||
int (*cmd_function_1arg)(t_gui_window *, char *);
|
||||
/* function called when user enters cmd */
|
||||
};
|
||||
|
||||
typedef struct t_weechat_alias t_weechat_alias;
|
||||
@@ -62,25 +66,28 @@ extern t_weechat_alias *alias_new (char *, char *);
|
||||
extern void alias_free_all ();
|
||||
extern char **explode_string (char *, char *, int, int *);
|
||||
extern void free_exploded_string (char **);
|
||||
extern int exec_weechat_command (t_irc_server *, char *);
|
||||
extern void user_command (t_irc_server *, t_gui_buffer *, char *);
|
||||
extern int weechat_cmd_alias (char *);
|
||||
extern int weechat_cmd_buffer (int, char **);
|
||||
extern int weechat_cmd_clear (int, char **);
|
||||
extern int weechat_cmd_connect (int, char **);
|
||||
extern int weechat_cmd_debug (int, char **);
|
||||
extern int weechat_cmd_disconnect (int, char **);
|
||||
extern int weechat_cmd_help (int, char **);
|
||||
extern int exec_weechat_command (t_gui_window *, t_irc_server *, char *);
|
||||
extern void user_command (t_gui_buffer *, t_irc_server *, char *);
|
||||
extern int weechat_cmd_alias (t_gui_window *, char *);
|
||||
extern int weechat_cmd_buffer (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_charset (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_clear (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_connect (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_debug (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_disconnect (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_help (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_history (t_gui_window *, int, char **);
|
||||
extern void weechat_cmd_ignore_display (char *, t_irc_ignore *);
|
||||
extern int weechat_cmd_ignore (int, char **);
|
||||
extern int weechat_cmd_key (char *);
|
||||
extern int weechat_cmd_plugin (int, char **);
|
||||
extern int weechat_cmd_save (int, char **);
|
||||
extern int weechat_cmd_server (int, char **);
|
||||
extern int weechat_cmd_set (char *);
|
||||
extern int weechat_cmd_unalias (char *);
|
||||
extern int weechat_cmd_unignore (int, char **);
|
||||
extern int weechat_cmd_uptime (int, char **);
|
||||
extern int weechat_cmd_window (int, char **);
|
||||
extern int weechat_cmd_ignore (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_key (t_gui_window *, char *);
|
||||
extern int weechat_cmd_plugin (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_save (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_server (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_set (t_gui_window *, char *);
|
||||
extern int weechat_cmd_unalias (t_gui_window *, char *);
|
||||
extern int weechat_cmd_unignore (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_upgrade (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_uptime (t_gui_window *, int, char **);
|
||||
extern int weechat_cmd_window (t_gui_window *, int, char **);
|
||||
|
||||
#endif /* command.h */
|
||||
|
||||
+585
-539
File diff suppressed because it is too large
Load Diff
+20
-17
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
@@ -33,27 +33,30 @@ typedef struct t_completion t_completion;
|
||||
struct t_completion
|
||||
{
|
||||
/* completion context */
|
||||
int context; /* context: null, nick, command, cmd arg */
|
||||
char *base_command; /* command with arg to complete (can be NULL) */
|
||||
int base_command_arg; /* # arg to complete (if context is cmd arg) */
|
||||
char *base_word; /* word to complete (when Tab was pressed) */
|
||||
int base_word_pos; /* beggining of base word */
|
||||
int position; /* position where Tab was pressed */
|
||||
char *args; /* command line args (including base word) */
|
||||
void *server; /* server pointer */
|
||||
void *channel; /* channel pointer */
|
||||
int context; /* context: null, nick, command, cmd arg */
|
||||
char *base_command; /* command with arg to complete (can be NULL) */
|
||||
int base_command_arg; /* # arg to complete (if context is cmd arg) */
|
||||
int arg_is_nick; /* argument is nick */
|
||||
char *base_word; /* word to complete (when Tab was pressed) */
|
||||
int base_word_pos; /* beggining of base word */
|
||||
int position; /* position where Tab was pressed */
|
||||
char *args; /* command line args (including base word) */
|
||||
|
||||
/* for command argument completion */
|
||||
t_weelist *completion_list; /* data list for completion */
|
||||
t_weelist *last_completion; /* last data element for completion */
|
||||
t_weelist *completion_list; /* data list for completion */
|
||||
t_weelist *last_completion; /* last data element for completion */
|
||||
|
||||
/* completion found */
|
||||
char *word_found; /* word found (to replace base word) */
|
||||
int position_replace; /* position where word has to be replaced */
|
||||
int diff_size; /* size difference (< 0 = char(s) deleted) */
|
||||
int diff_length; /* length difference (<= diff_size) */
|
||||
char *word_found; /* word found (to replace base word) */
|
||||
int position_replace; /* position where word has to be replaced */
|
||||
int diff_size; /* size difference (< 0 = char(s) deleted) */
|
||||
int diff_length; /* length difference (<= diff_size) */
|
||||
};
|
||||
|
||||
extern void completion_init (t_completion *);
|
||||
extern void completion_init (t_completion *, void *, void *);
|
||||
extern void completion_free (t_completion *);
|
||||
extern void completion_search (t_completion *, void *, char *, int, int);
|
||||
extern void completion_search (t_completion *, char *, int, int);
|
||||
|
||||
#endif /* completion.h */
|
||||
|
||||
+20
-22
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* fifo.c: FIFO pipe for WeeChat remote control */
|
||||
@@ -70,8 +70,9 @@ fifo_create ()
|
||||
gui_printf (NULL,
|
||||
_("%s unable to create FIFO pipe for remote control (%s)\n"),
|
||||
WEECHAT_ERROR, weechat_fifo_filename);
|
||||
wee_log_printf (_("%s unable to create FIFO pipe for remote control (%s)\n"),
|
||||
WEECHAT_ERROR, weechat_fifo_filename);
|
||||
weechat_log_printf (_("%s unable to create FIFO pipe for "
|
||||
"remote control (%s)\n"),
|
||||
WEECHAT_ERROR, weechat_fifo_filename);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -81,12 +82,12 @@ fifo_create ()
|
||||
gui_printf (NULL,
|
||||
_("%s unable to open FIFO pipe (%s) for reading\n"),
|
||||
WEECHAT_ERROR, weechat_fifo_filename);
|
||||
wee_log_printf (_("%s unable to open FIFO pipe (%s) for reading\n"),
|
||||
WEECHAT_ERROR, weechat_fifo_filename);
|
||||
weechat_log_printf (_("%s unable to open FIFO pipe (%s) for reading\n"),
|
||||
WEECHAT_ERROR, weechat_fifo_filename);
|
||||
return;
|
||||
}
|
||||
|
||||
wee_log_printf (_("FIFO pipe is open\n"));
|
||||
weechat_log_printf (_("FIFO pipe is open\n"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,19 +148,16 @@ fifo_exec (char *text)
|
||||
WEECHAT_WARNING, text);
|
||||
return;
|
||||
}
|
||||
if (ptr_server)
|
||||
if (ptr_server && pos)
|
||||
{
|
||||
if (pos)
|
||||
ptr_channel = channel_search (ptr_server, pos + 1);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
ptr_channel = channel_search (ptr_server, pos + 1);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s channel \"%s\" not found (FIFO pipe data)\n"),
|
||||
WEECHAT_WARNING, pos + 1);
|
||||
return;
|
||||
}
|
||||
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
|
||||
gui_printf (NULL,
|
||||
_("%s channel \"%s\" not found (FIFO pipe data)\n"),
|
||||
WEECHAT_WARNING, pos + 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +171,7 @@ fifo_exec (char *text)
|
||||
ptr_buffer = gui_buffers;
|
||||
}
|
||||
|
||||
user_command (ptr_server, ptr_buffer, pos_msg);
|
||||
user_command (ptr_buffer, ptr_server, pos_msg);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -249,8 +247,8 @@ fifo_read ()
|
||||
gui_printf (NULL,
|
||||
_("%s error reading FIFO pipe, closing it\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_log_printf (_("%s error reading FIFO pipe, closing it\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_log_printf (_("%s error reading FIFO pipe, closing it\n"),
|
||||
WEECHAT_ERROR);
|
||||
fifo_remove ();
|
||||
}
|
||||
else
|
||||
@@ -291,5 +289,5 @@ fifo_remove ()
|
||||
weechat_fifo_filename = NULL;
|
||||
}
|
||||
|
||||
wee_log_printf (_("FIFO pipe is closed\n"));
|
||||
weechat_log_printf (_("FIFO pipe is closed\n"));
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
|
||||
+81
-63
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* history.c: memorize commands or text */
|
||||
@@ -66,74 +66,92 @@ history_hide_password (char *string)
|
||||
}
|
||||
|
||||
/*
|
||||
* history_add: add a text/command to history
|
||||
* history_buffer_add: add a text/command to buffer's history
|
||||
*/
|
||||
|
||||
void
|
||||
history_add (void *buffer, char *string)
|
||||
history_buffer_add (void *buffer, char *string)
|
||||
{
|
||||
t_history *new_history, *ptr_history;
|
||||
|
||||
/* add history to global history */
|
||||
new_history = (t_history *)malloc (sizeof (t_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
history_hide_password (new_history->text);
|
||||
|
||||
if (history_global)
|
||||
history_global->prev_history = new_history;
|
||||
else
|
||||
history_global_last = new_history;
|
||||
new_history->next_history = history_global;
|
||||
new_history->prev_history = NULL;
|
||||
history_global = new_history;
|
||||
num_history_global++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((cfg_history_max_commands > 0)
|
||||
&& (num_history_global > cfg_history_max_commands))
|
||||
{
|
||||
ptr_history = history_global_last->prev_history;
|
||||
history_global_last->prev_history->next_history = NULL;
|
||||
if (history_global_last->text)
|
||||
free (history_global_last->text);
|
||||
free (history_global_last);
|
||||
history_global_last = ptr_history;
|
||||
num_history_global--;
|
||||
}
|
||||
if ( !((t_gui_buffer *)(buffer))->history
|
||||
|| ( ((t_gui_buffer *)(buffer))->history
|
||||
&& ascii_strcasecmp (((t_gui_buffer *)(buffer))->history->text, string) != 0))
|
||||
{
|
||||
new_history = (t_history *)malloc (sizeof (t_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
history_hide_password (new_history->text);
|
||||
|
||||
if (((t_gui_buffer *)(buffer))->history)
|
||||
((t_gui_buffer *)(buffer))->history->prev_history = new_history;
|
||||
else
|
||||
((t_gui_buffer *)(buffer))->last_history = new_history;
|
||||
new_history->next_history = ((t_gui_buffer *)(buffer))->history;
|
||||
new_history->prev_history = NULL;
|
||||
((t_gui_buffer *)buffer)->history = new_history;
|
||||
((t_gui_buffer *)buffer)->num_history++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((cfg_history_max_commands > 0)
|
||||
&& (((t_gui_buffer *)(buffer))->num_history > cfg_history_max_commands))
|
||||
{
|
||||
ptr_history = ((t_gui_buffer *)buffer)->last_history->prev_history;
|
||||
((t_gui_buffer *)buffer)->last_history->prev_history->next_history = NULL;
|
||||
if (((t_gui_buffer *)buffer)->last_history->text)
|
||||
free (((t_gui_buffer *)buffer)->last_history->text);
|
||||
free (((t_gui_buffer *)buffer)->last_history);
|
||||
((t_gui_buffer *)buffer)->last_history = ptr_history;
|
||||
((t_gui_buffer *)(buffer))->num_history++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* add history to local history */
|
||||
new_history = (t_history *)malloc (sizeof (t_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
history_hide_password (new_history->text);
|
||||
|
||||
if (((t_gui_buffer *)(buffer))->history)
|
||||
((t_gui_buffer *)(buffer))->history->prev_history = new_history;
|
||||
else
|
||||
((t_gui_buffer *)(buffer))->last_history = new_history;
|
||||
new_history->next_history = ((t_gui_buffer *)(buffer))->history;
|
||||
new_history->prev_history = NULL;
|
||||
((t_gui_buffer *)buffer)->history = new_history;
|
||||
((t_gui_buffer *)(buffer))->num_history++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((cfg_history_max_commands > 0)
|
||||
&& (((t_gui_buffer *)(buffer))->num_history > cfg_history_max_commands))
|
||||
{
|
||||
ptr_history = ((t_gui_buffer *)buffer)->last_history->prev_history;
|
||||
((t_gui_buffer *)buffer)->last_history->prev_history->next_history = NULL;
|
||||
if (((t_gui_buffer *)buffer)->last_history->text)
|
||||
free (((t_gui_buffer *)buffer)->last_history->text);
|
||||
free (((t_gui_buffer *)buffer)->last_history);
|
||||
((t_gui_buffer *)buffer)->last_history = ptr_history;
|
||||
((t_gui_buffer *)(buffer))->num_history++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* history_global_add: add a text/command to buffer's history
|
||||
*/
|
||||
|
||||
void
|
||||
history_global_add (char *string)
|
||||
{
|
||||
t_history *new_history, *ptr_history;
|
||||
|
||||
if (!history_global
|
||||
|| (history_global
|
||||
&& ascii_strcasecmp (history_global->text, string) != 0))
|
||||
{
|
||||
new_history = (t_history *)malloc (sizeof (t_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
if (cfg_log_hide_nickserv_pwd)
|
||||
history_hide_password (new_history->text);
|
||||
|
||||
if (history_global)
|
||||
history_global->prev_history = new_history;
|
||||
else
|
||||
history_global_last = new_history;
|
||||
new_history->next_history = history_global;
|
||||
new_history->prev_history = NULL;
|
||||
history_global = new_history;
|
||||
num_history_global++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((cfg_history_max_commands > 0)
|
||||
&& (num_history_global > cfg_history_max_commands))
|
||||
{
|
||||
ptr_history = history_global_last->prev_history;
|
||||
history_global_last->prev_history->next_history = NULL;
|
||||
if (history_global_last->text)
|
||||
free (history_global_last->text);
|
||||
free (history_global_last);
|
||||
history_global_last = ptr_history;
|
||||
num_history_global--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ extern t_history *history_global;
|
||||
extern t_history *history_global_last;
|
||||
extern t_history *history_global_ptr;
|
||||
|
||||
extern void history_add (void *, char *);
|
||||
extern void history_buffer_add (void *, char *);
|
||||
extern void history_global_add (char *);
|
||||
extern void history_global_free ();
|
||||
extern void history_buffer_free (void *);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* hotlist.c: WeeChat hotlist (buffers with activity) */
|
||||
@@ -76,7 +76,7 @@ hotlist_find_pos (t_weechat_hotlist *new_hotlist)
|
||||
*/
|
||||
|
||||
void
|
||||
hotlist_add (int priority, t_gui_buffer *buffer)
|
||||
hotlist_add (int priority, t_irc_server *server, t_gui_buffer *buffer)
|
||||
{
|
||||
t_weechat_hotlist *new_hotlist, *pos_hotlist;
|
||||
|
||||
@@ -104,6 +104,7 @@ hotlist_add (int priority, t_gui_buffer *buffer)
|
||||
}
|
||||
|
||||
new_hotlist->priority = priority;
|
||||
new_hotlist->server = server;
|
||||
new_hotlist->buffer = buffer;
|
||||
|
||||
if (hotlist)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ struct t_weechat_hotlist
|
||||
{
|
||||
int priority; /* 0=crappy msg (join/part), 1=msg, */
|
||||
/* 2=pv, 3=nick highlight */
|
||||
t_irc_server *server; /* associated server */
|
||||
t_gui_buffer *buffer; /* associated buffer */
|
||||
t_weechat_hotlist *prev_hotlist; /* link to previous hotlist */
|
||||
t_weechat_hotlist *next_hotlist; /* link to next hotlist */
|
||||
@@ -42,7 +43,7 @@ struct t_weechat_hotlist
|
||||
extern t_weechat_hotlist *hotlist;
|
||||
extern t_gui_buffer *hotlist_initial_buffer;
|
||||
|
||||
extern void hotlist_add (int, t_gui_buffer *);
|
||||
extern void hotlist_add (int, t_irc_server *, t_gui_buffer *);
|
||||
extern void hotlist_free (t_weechat_hotlist *);
|
||||
extern void hotlist_free_all ();
|
||||
extern void hotlist_remove_buffer (t_gui_buffer *);
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* log.c: log buffers to files */
|
||||
@@ -120,7 +120,7 @@ log_start (t_gui_buffer *buffer)
|
||||
buffer->log_filename = (char *) malloc (length);
|
||||
if (!buffer->log_filename)
|
||||
{
|
||||
wee_log_printf (_("Not enough memory to write log file for a buffer\n"));
|
||||
weechat_log_printf (_("Not enough memory to write log file for a buffer\n"));
|
||||
return;
|
||||
}
|
||||
if (cfg_log_path[0] == '~')
|
||||
@@ -148,7 +148,7 @@ log_start (t_gui_buffer *buffer)
|
||||
buffer->log_file = fopen (buffer->log_filename, "a");
|
||||
if (!buffer->log_file)
|
||||
{
|
||||
wee_log_printf (_("Unable to write log file for a buffer\n"));
|
||||
weechat_log_printf (_("Unable to write log file for a buffer\n"));
|
||||
free (buffer->log_filename);
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,179 @@
|
||||
/*
|
||||
* 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_SESSION_H
|
||||
#define __WEECHAT_SESSION_H 1
|
||||
|
||||
#define WEECHAT_SESSION_NAME "weechat_session.bin"
|
||||
|
||||
#define SESSION_SIGNATURE "== WeeChat Upgrade file v1.0 - binary, do not edit! =="
|
||||
|
||||
/* For developers: please add new values ONLY AT THE END of enums */
|
||||
|
||||
enum t_session_type
|
||||
{
|
||||
SESSION_TYPE_INT = 0,
|
||||
SESSION_TYPE_STR,
|
||||
SESSION_TYPE_BUF
|
||||
};
|
||||
|
||||
enum t_session_object
|
||||
{
|
||||
SESSION_OBJ_END = 0,
|
||||
SESSION_OBJ_SERVER,
|
||||
SESSION_OBJ_CHANNEL,
|
||||
SESSION_OBJ_NICK,
|
||||
SESSION_OBJ_DCC,
|
||||
SESSION_OBJ_HISTORY,
|
||||
SESSION_OBJ_BUFFER,
|
||||
SESSION_OBJ_LINE,
|
||||
SESSION_OBJ_UPTIME
|
||||
};
|
||||
|
||||
enum t_session_server
|
||||
{
|
||||
SESSION_SERV_END = 0,
|
||||
SESSION_SERV_NAME,
|
||||
SESSION_SERV_AUTOCONNECT,
|
||||
SESSION_SERV_AUTORECONNECT,
|
||||
SESSION_SERV_AUTORECONNECT_DELAY,
|
||||
SESSION_SERV_COMMAND_LINE,
|
||||
SESSION_SERV_ADDRESS,
|
||||
SESSION_SERV_PORT,
|
||||
SESSION_SERV_IPV6,
|
||||
SESSION_SERV_SSL,
|
||||
SESSION_SERV_PASSWORD,
|
||||
SESSION_SERV_NICK1,
|
||||
SESSION_SERV_NICK2,
|
||||
SESSION_SERV_NICK3,
|
||||
SESSION_SERV_USERNAME,
|
||||
SESSION_SERV_REALNAME,
|
||||
SESSION_SERV_COMMAND,
|
||||
SESSION_SERV_COMMAND_DELAY,
|
||||
SESSION_SERV_AUTOJOIN,
|
||||
SESSION_SERV_AUTOREJOIN,
|
||||
SESSION_SERV_NOTIFY_LEVELS,
|
||||
SESSION_SERV_CHILD_PID,
|
||||
SESSION_SERV_CHILD_READ,
|
||||
SESSION_SERV_CHILD_WRITE,
|
||||
SESSION_SERV_SOCK,
|
||||
SESSION_SERV_IS_CONNECTED,
|
||||
SESSION_SERV_SSL_CONNECTED,
|
||||
SESSION_SERV_GNUTLS_SESS,
|
||||
SESSION_SERV_UNTERMINATED_MESSAGE,
|
||||
SESSION_SERV_NICK,
|
||||
SESSION_SERV_RECONNECT_START,
|
||||
SESSION_SERV_RECONNECT_JOIN,
|
||||
SESSION_SERV_IS_AWAY,
|
||||
SESSION_SERV_AWAY_TIME,
|
||||
SESSION_SERV_LAG,
|
||||
SESSION_SERV_LAG_CHECK_TIME,
|
||||
SESSION_SERV_LAG_NEXT_CHECK,
|
||||
SESSION_SERV_CHARSET_DECODE_ISO,
|
||||
SESSION_SERV_CHARSET_DECODE_UTF,
|
||||
SESSION_SERV_CHARSET_ENCODE
|
||||
};
|
||||
|
||||
enum t_session_channel
|
||||
{
|
||||
SESSION_CHAN_END = 0,
|
||||
SESSION_CHAN_TYPE,
|
||||
SESSION_CHAN_NAME,
|
||||
SESSION_CHAN_TOPIC,
|
||||
SESSION_CHAN_MODES,
|
||||
SESSION_CHAN_LIMIT,
|
||||
SESSION_CHAN_KEY,
|
||||
SESSION_CHAN_NICKS_COUNT,
|
||||
SESSION_CHAN_CHECKING_AWAY
|
||||
};
|
||||
|
||||
enum t_session_nick
|
||||
{
|
||||
SESSION_NICK_END = 0,
|
||||
SESSION_NICK_NICK,
|
||||
SESSION_NICK_FLAGS,
|
||||
SESSION_NICK_COLOR
|
||||
};
|
||||
|
||||
enum t_session_dcc
|
||||
{
|
||||
SESSION_DCC_END = 0,
|
||||
SESSION_DCC_SERVER,
|
||||
SESSION_DCC_CHANNEL,
|
||||
SESSION_DCC_TYPE,
|
||||
SESSION_DCC_STATUS,
|
||||
SESSION_DCC_START_TIME,
|
||||
SESSION_DCC_START_TRANSFER,
|
||||
SESSION_DCC_ADDR,
|
||||
SESSION_DCC_PORT,
|
||||
SESSION_DCC_NICK,
|
||||
SESSION_DCC_SOCK,
|
||||
SESSION_DCC_UNTERMINATED_MESSAGE,
|
||||
SESSION_DCC_FILE,
|
||||
SESSION_DCC_FILENAME,
|
||||
SESSION_DCC_LOCAL_FILENAME,
|
||||
SESSION_DCC_FILENAME_SUFFIX,
|
||||
SESSION_DCC_SIZE,
|
||||
SESSION_DCC_POS,
|
||||
SESSION_DCC_ACK,
|
||||
SESSION_DCC_START_RESUME,
|
||||
SESSION_DCC_LAST_CHECK_TIME,
|
||||
SESSION_DCC_LAST_CHECK_POS,
|
||||
SESSION_DCC_LAST_ACTIVITY,
|
||||
SESSION_DCC_BYTES_PER_SEC,
|
||||
SESSION_DCC_ETA
|
||||
};
|
||||
|
||||
enum t_session_history
|
||||
{
|
||||
SESSION_HIST_END = 0,
|
||||
SESSION_HIST_TEXT
|
||||
};
|
||||
|
||||
enum t_session_buffer
|
||||
{
|
||||
SESSION_BUFF_END = 0,
|
||||
SESSION_BUFF_SERVER,
|
||||
SESSION_BUFF_CHANNEL,
|
||||
SESSION_BUFF_DCC
|
||||
};
|
||||
|
||||
enum t_session_line
|
||||
{
|
||||
SESSION_LINE_END = 0,
|
||||
SESSION_LINE_LENGTH,
|
||||
SESSION_LINE_LENGTH_ALIGN,
|
||||
SESSION_LINE_LOG_WRITE,
|
||||
SESSION_LINE_WITH_MESSAGE,
|
||||
SESSION_LINE_WITH_HIGHLIGHT,
|
||||
SESSION_LINE_DATA,
|
||||
SESSION_LINE_OFS_AFTER_DATE
|
||||
};
|
||||
|
||||
enum t_session_uptime
|
||||
{
|
||||
SESSION_UPT_END = 0,
|
||||
SESSION_UPT_START_TIME
|
||||
};
|
||||
|
||||
int session_save (char *filename);
|
||||
int session_load (char *filename);
|
||||
|
||||
#endif /* session.h */
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* utf8.c: UTF-8 string functions for WeeChat */
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
|
||||
+234
-175
@@ -14,7 +14,7 @@
|
||||
* ### ###
|
||||
* ############################################################################
|
||||
*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -29,7 +29,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* weechat.c: core functions for WeeChat */
|
||||
@@ -65,6 +65,7 @@
|
||||
#include "command.h"
|
||||
#include "fifo.h"
|
||||
#include "utf8.h"
|
||||
#include "session.h"
|
||||
#include "../irc/irc.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
@@ -73,6 +74,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
char *weechat_argv0 = NULL; /* WeeChat binary file name (argv[0]) */
|
||||
char *weechat_session = NULL; /* WeeChat session file (for /upgrade command) */
|
||||
time_t weechat_start_time; /* WeeChat start time (used by /uptime command) */
|
||||
int quit_weechat; /* = 1 if quit request from user... why ? :'( */
|
||||
int sigsegv = 0; /* SIGSEGV received? */
|
||||
@@ -163,11 +166,11 @@ ascii_strncasecmp (char *string1, char *string2, int max)
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_log_printf: displays a message in WeeChat log (~/.weechat/weechat.log)
|
||||
* weechat_log_printf: displays a message in WeeChat log (~/.weechat/weechat.log)
|
||||
*/
|
||||
|
||||
void
|
||||
wee_log_printf (char *message, ...)
|
||||
weechat_log_printf (char *message, ...)
|
||||
{
|
||||
static char buffer[4096];
|
||||
char *ptr_buffer;
|
||||
@@ -206,15 +209,15 @@ wee_log_printf (char *message, ...)
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_convert_encoding: convert string to another encoding
|
||||
* weechat_iconv: convert string to another charset
|
||||
*/
|
||||
|
||||
char *
|
||||
weechat_convert_encoding (char *from_code, char *to_code, char *string)
|
||||
weechat_iconv (char *from_code, char *to_code, char *string)
|
||||
{
|
||||
char *outbuf;
|
||||
|
||||
#ifdef HAVE_ICONV
|
||||
#ifdef HAVE_ICONV
|
||||
iconv_t cd;
|
||||
char *inbuf;
|
||||
ICONV_CONST char *ptr_inbuf;
|
||||
@@ -249,12 +252,12 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
|
||||
}
|
||||
else
|
||||
outbuf = strdup (string);
|
||||
#else
|
||||
#else
|
||||
/* make gcc happy */
|
||||
(void) from_code;
|
||||
(void) to_code;
|
||||
outbuf = strdup (string);
|
||||
#endif /* HAVE_ICONV */
|
||||
#endif /* HAVE_ICONV */
|
||||
|
||||
return outbuf;
|
||||
}
|
||||
@@ -263,7 +266,8 @@ weechat_convert_encoding (char *from_code, char *to_code, char *string)
|
||||
* get_timeval_diff: calculates difference between two times (return in milliseconds)
|
||||
*/
|
||||
|
||||
long get_timeval_diff(struct timeval *tv1, struct timeval *tv2)
|
||||
long
|
||||
get_timeval_diff (struct timeval *tv1, struct timeval *tv2)
|
||||
{
|
||||
long diff_sec, diff_usec;
|
||||
|
||||
@@ -279,10 +283,40 @@ long get_timeval_diff(struct timeval *tv1, struct timeval *tv2)
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_config_options: display config options
|
||||
* weechat_display_usage: display WeeChat usage
|
||||
*/
|
||||
|
||||
void wee_display_config_options ()
|
||||
void
|
||||
weechat_display_usage (char *exec_name)
|
||||
{
|
||||
printf ("\n");
|
||||
printf (_("%s (c) Copyright 2003-2006, compiled on %s %s\n"
|
||||
"Developed by FlashCode <flashcode@flashtux.org> - %s"),
|
||||
PACKAGE_STRING, __DATE__, __TIME__, WEECHAT_WEBSITE);
|
||||
printf ("\n\n");
|
||||
printf (_("Usage: %s [options ...]\n" \
|
||||
" or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]"),
|
||||
exec_name, exec_name);
|
||||
printf ("\n\n");
|
||||
printf (_(" -a, --no-connect disable auto-connect to servers at startup\n"
|
||||
" -c, --config display config file options\n"
|
||||
" -f, --key-functions display WeeChat internal functions for keys\n"
|
||||
" -h, --help this help\n"
|
||||
" -i, --irc-commands display IRC commands\n"
|
||||
" -k, --keys display WeeChat default keys\n"
|
||||
" -l, --license display WeeChat license\n"
|
||||
" -p, --no-plugin don't load any plugin at startup\n"
|
||||
" -v, --version display WeeChat version\n"
|
||||
" -w, --weechat-commands display WeeChat commands\n"));
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_display_config_options: display config options
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_display_config_options ()
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
@@ -299,64 +333,67 @@ void wee_display_config_options ()
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
printf (_(" . type boolean (values: 'on' or 'off')\n"));
|
||||
printf (_(" . type: boolean\n"));
|
||||
printf (_(" . values: 'on' or 'off'\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_int == BOOL_TRUE) ?
|
||||
"on" : "off");
|
||||
(weechat_options[i][j].default_int == BOOL_TRUE) ?
|
||||
"on" : "off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
printf (_(" . type integer (values: between %d and %d)\n"),
|
||||
weechat_options[i][j].min,
|
||||
weechat_options[i][j].max);
|
||||
printf (_(" . type: integer\n"));
|
||||
printf (_(" . values: between %d and %d\n"),
|
||||
weechat_options[i][j].min,
|
||||
weechat_options[i][j].max);
|
||||
printf (_(" . default value: %d\n"),
|
||||
weechat_options[i][j].default_int);
|
||||
weechat_options[i][j].default_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
printf (_(" . type string (values: "));
|
||||
printf (_(" . type: string\n"));
|
||||
printf (_(" . values: "));
|
||||
k = 0;
|
||||
while (weechat_options[i][j].array_values[k])
|
||||
{
|
||||
printf ("'%s'",
|
||||
weechat_options[i][j].array_values[k]);
|
||||
weechat_options[i][j].array_values[k]);
|
||||
if (weechat_options[i][j].array_values[k + 1])
|
||||
printf (", ");
|
||||
k++;
|
||||
}
|
||||
printf (")\n");
|
||||
printf ("\n");
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
printf (_(" . type color (Curses or Gtk color, look at WeeChat doc)\n"));
|
||||
printf (_(" . type: color\n"));
|
||||
printf (_(" . values: Curses or Gtk color\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
printf (_(" . type string (any string)\n"));
|
||||
printf (_(" . type: string\n"));
|
||||
printf (_(" . values: any string\n"));
|
||||
printf (_(" . default value: '%s'\n"),
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
(weechat_options[i][j].default_string) ?
|
||||
weechat_options[i][j].default_string : _("empty"));
|
||||
break;
|
||||
}
|
||||
printf (_(" . description: %s\n"),
|
||||
_(weechat_options[i][j].long_description));
|
||||
_(weechat_options[i][j].long_description));
|
||||
printf ("\n");
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf (_("Moreover, you can define aliases in [alias] section, by adding lines like:\n"));
|
||||
printf ("j=join\n");
|
||||
printf (_("where 'j' is alias name, and 'join' associated command.\n\n"));
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_commands: display WeeChat and/or IRC commands
|
||||
* weechat_display_commands: display WeeChat and/or IRC commands
|
||||
*/
|
||||
|
||||
void wee_display_commands (int weechat_cmd, int irc_cmd)
|
||||
void
|
||||
weechat_display_commands (int weechat_cmd, int irc_cmd)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -406,10 +443,11 @@ void wee_display_commands (int weechat_cmd, int irc_cmd)
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_key_functions: display WeeChat key functions
|
||||
* weechat_display_key_functions: display WeeChat key functions
|
||||
*/
|
||||
|
||||
void wee_display_key_functions ()
|
||||
void
|
||||
weechat_display_key_functions ()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -426,11 +464,11 @@ void wee_display_key_functions ()
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_display_keys: display WeeChat default keys
|
||||
* weechat_display_keys: display WeeChat default keys
|
||||
*/
|
||||
|
||||
void
|
||||
wee_display_keys ()
|
||||
weechat_display_keys ()
|
||||
{
|
||||
t_gui_key *ptr_key;
|
||||
char *expanded_name;
|
||||
@@ -449,15 +487,17 @@ wee_display_keys ()
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_parse_args: parse command line args
|
||||
* weechat_parse_args: parse command line args
|
||||
*/
|
||||
|
||||
void
|
||||
wee_parse_args (int argc, char *argv[])
|
||||
weechat_parse_args (int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
t_irc_server server_tmp;
|
||||
|
||||
weechat_argv0 = strdup (argv[0]);
|
||||
weechat_session = NULL;
|
||||
server_cmd_line = 0;
|
||||
auto_connect = 1;
|
||||
auto_load_plugins = 1;
|
||||
@@ -470,54 +510,65 @@ wee_parse_args (int argc, char *argv[])
|
||||
else if ((strcmp (argv[i], "-c") == 0)
|
||||
|| (strcmp (argv[i], "--config") == 0))
|
||||
{
|
||||
wee_display_config_options ();
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
weechat_display_config_options ();
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-f") == 0)
|
||||
|| (strcmp (argv[i], "--key-functions") == 0))
|
||||
{
|
||||
wee_display_key_functions ();
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
weechat_display_key_functions ();
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-h") == 0)
|
||||
|| (strcmp (argv[i], "--help") == 0))
|
||||
{
|
||||
printf ("\n" WEE_USAGE1, argv[0], argv[0]);
|
||||
printf ("%s", WEE_USAGE2);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
weechat_display_usage (argv[0]);
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-i") == 0)
|
||||
|| (strcmp (argv[i], "--irc-commands") == 0))
|
||||
{
|
||||
wee_display_commands (0, 1);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
weechat_display_commands (0, 1);
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-k") == 0)
|
||||
|| (strcmp (argv[i], "--keys") == 0))
|
||||
{
|
||||
wee_display_keys ();
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
weechat_display_keys ();
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-l") == 0)
|
||||
|| (strcmp (argv[i], "--license") == 0))
|
||||
{
|
||||
printf ("\n%s%s", WEE_LICENSE);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-p") == 0)
|
||||
|| (strcmp (argv[i], "--no-plugin") == 0))
|
||||
auto_load_plugins = 0;
|
||||
else if (strcmp (argv[i], "--session") == 0)
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
weechat_session = strdup (argv[++i]);
|
||||
else
|
||||
{
|
||||
fprintf (stderr,
|
||||
_("%s missing argument for --session option\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
}
|
||||
else if ((strcmp (argv[i], "-v") == 0)
|
||||
|| (strcmp (argv[i], "--version") == 0))
|
||||
{
|
||||
printf (PACKAGE_VERSION "\n");
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((strcmp (argv[i], "-w") == 0)
|
||||
|| (strcmp (argv[i], "--weechat-commands") == 0))
|
||||
{
|
||||
wee_display_commands (1, 0);
|
||||
wee_shutdown (EXIT_SUCCESS, 0);
|
||||
weechat_display_commands (1, 0);
|
||||
weechat_shutdown (EXIT_SUCCESS, 0);
|
||||
}
|
||||
else if ((ascii_strncasecmp (argv[i], "irc", 3) == 0))
|
||||
{
|
||||
@@ -535,7 +586,8 @@ wee_parse_args (int argc, char *argv[])
|
||||
server_tmp.ipv6, server_tmp.ssl,
|
||||
server_tmp.password, server_tmp.nick1,
|
||||
server_tmp.nick2, server_tmp.nick3,
|
||||
NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL))
|
||||
NULL, NULL, NULL, 0, server_tmp.autojoin, 1, NULL,
|
||||
NULL, NULL, NULL))
|
||||
fprintf (stderr, _("%s unable to create server ('%s'), ignored\n"),
|
||||
WEECHAT_WARNING, argv[i]);
|
||||
server_destroy (&server_tmp);
|
||||
@@ -552,13 +604,13 @@ wee_parse_args (int argc, char *argv[])
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_create_dir: create a directory
|
||||
* return: 1 if ok (or directory already exists)
|
||||
* 0 if error
|
||||
* weechat_create_dir: create a directory
|
||||
* return: 1 if ok (or directory already exists)
|
||||
* 0 if error
|
||||
*/
|
||||
|
||||
int
|
||||
wee_create_dir (char *directory)
|
||||
weechat_create_dir (char *directory)
|
||||
{
|
||||
if (mkdir (directory, 0755) < 0)
|
||||
{
|
||||
@@ -574,26 +626,21 @@ wee_create_dir (char *directory)
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_create_home_dirs: create (if not found):
|
||||
* - WeeChat home directory ("~/.weechat")
|
||||
* - "perl" directory (and "autoload")
|
||||
* - "ruby" directory (and "autoload")
|
||||
* - "python" directory (and "autoload")
|
||||
* weechat_create_home_dirs: create WeeChat directories (if not found)
|
||||
*/
|
||||
|
||||
void
|
||||
wee_create_home_dirs ()
|
||||
weechat_create_home_dirs ()
|
||||
{
|
||||
char *ptr_home, *dir_name;
|
||||
int dir_length;
|
||||
|
||||
/* TODO: rewrite this code for Windows version */
|
||||
|
||||
ptr_home = getenv ("HOME");
|
||||
if (!ptr_home)
|
||||
{
|
||||
fprintf (stderr, _("%s unable to get HOME directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
dir_length = strlen (ptr_home) + 10;
|
||||
weechat_home =
|
||||
@@ -602,17 +649,17 @@ wee_create_home_dirs ()
|
||||
{
|
||||
fprintf (stderr, _("%s not enough memory for home directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
snprintf (weechat_home, dir_length, "%s%s.weechat", ptr_home,
|
||||
DIR_SEPARATOR);
|
||||
|
||||
/* create home directory "~/.weechat" ; error is fatal */
|
||||
if (!wee_create_dir (weechat_home))
|
||||
if (!weechat_create_dir (weechat_home))
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create ~/.weechat directory\n"),
|
||||
WEECHAT_ERROR);
|
||||
wee_shutdown (EXIT_FAILURE, 0);
|
||||
weechat_shutdown (EXIT_FAILURE, 0);
|
||||
}
|
||||
|
||||
dir_length = strlen (weechat_home) + 64;
|
||||
@@ -621,7 +668,7 @@ wee_create_home_dirs ()
|
||||
/* create "~/.weechat/logs" */
|
||||
snprintf (dir_name, dir_length, "%s%s%s", weechat_home, DIR_SEPARATOR,
|
||||
"logs");
|
||||
if (!wee_create_dir (dir_name))
|
||||
if (!weechat_create_dir (dir_name))
|
||||
{
|
||||
fprintf (stderr, _("%s unable to create ~/.weechat/logs directory\n"),
|
||||
WEECHAT_WARNING);
|
||||
@@ -632,11 +679,11 @@ wee_create_home_dirs ()
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_init_vars: initialize some variables
|
||||
* weechat_init_vars: initialize some variables
|
||||
*/
|
||||
|
||||
void
|
||||
wee_init_vars ()
|
||||
weechat_init_vars ()
|
||||
{
|
||||
/* start time, used by /uptime command */
|
||||
weechat_start_time = time (NULL);
|
||||
@@ -654,11 +701,11 @@ wee_init_vars ()
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_init_log: initialize log file
|
||||
* weechat_init_log: initialize log file
|
||||
*/
|
||||
|
||||
void
|
||||
wee_init_log ()
|
||||
weechat_init_log ()
|
||||
{
|
||||
int filename_length;
|
||||
char *filename;
|
||||
@@ -674,6 +721,29 @@ wee_init_log ()
|
||||
free (filename);
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_config_read: read WeeChat config file
|
||||
*/
|
||||
|
||||
void
|
||||
weechat_config_read ()
|
||||
{
|
||||
switch (config_read ())
|
||||
{
|
||||
case 0: /* read ok */
|
||||
break;
|
||||
case -1: /* config file not found */
|
||||
if (config_create_default () < 0)
|
||||
exit (EXIT_FAILURE);
|
||||
if (config_read () != 0)
|
||||
exit (EXIT_FAILURE);
|
||||
break;
|
||||
default: /* other error (fatal) */
|
||||
server_free_all ();
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_welcome_message: display WeeChat welcome message - yeah!
|
||||
*/
|
||||
@@ -720,29 +790,19 @@ weechat_welcome_message ()
|
||||
"%s-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_NICK));
|
||||
|
||||
wee_log_printf ("%s (%s %s %s)\n",
|
||||
PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
|
||||
weechat_log_printf ("%s (%s %s %s)\n",
|
||||
PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_gui_shutdown: shutdown WeeChat GUI
|
||||
* weechat_shutdown: shutdown WeeChat
|
||||
*/
|
||||
|
||||
void
|
||||
wee_gui_shutdown ()
|
||||
{
|
||||
dcc_end ();
|
||||
server_free_all ();
|
||||
gui_end ();
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_shutdown: shutdown WeeChat
|
||||
*/
|
||||
|
||||
void
|
||||
wee_shutdown (int return_code, int crash)
|
||||
weechat_shutdown (int return_code, int crash)
|
||||
{
|
||||
if (weechat_argv0)
|
||||
free (weechat_argv0);
|
||||
fifo_remove ();
|
||||
if (weechat_home)
|
||||
free (weechat_home);
|
||||
@@ -764,15 +824,16 @@ wee_shutdown (int return_code, int crash)
|
||||
}
|
||||
|
||||
/*
|
||||
* wee_dump writes dump to WeeChat log file
|
||||
* weechat_dump writes dump to WeeChat log file
|
||||
*/
|
||||
|
||||
void
|
||||
wee_dump (int crash)
|
||||
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;
|
||||
|
||||
@@ -783,92 +844,100 @@ wee_dump (int crash)
|
||||
if (crash)
|
||||
{
|
||||
sigsegv = 1;
|
||||
wee_log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)...\n");
|
||||
weechat_log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)...\n");
|
||||
}
|
||||
|
||||
wee_log_printf ("\n");
|
||||
weechat_log_printf ("\n");
|
||||
if (crash)
|
||||
{
|
||||
wee_log_printf ("****** WeeChat CRASH DUMP ******\n");
|
||||
wee_log_printf ("****** Please send this file to WeeChat developers ******\n");
|
||||
wee_log_printf ("****** and explain when this crash happened ******\n");
|
||||
weechat_log_printf ("****** WeeChat CRASH DUMP ******\n");
|
||||
weechat_log_printf ("****** Please send this file to WeeChat developers ******\n");
|
||||
weechat_log_printf ("****** and explain when this crash happened ******\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
wee_log_printf ("****** WeeChat dump request ******\n");
|
||||
weechat_log_printf ("****** WeeChat dump request ******\n");
|
||||
}
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server)
|
||||
{
|
||||
wee_log_printf ("\n");
|
||||
weechat_log_printf ("\n");
|
||||
server_print_log (ptr_server);
|
||||
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
wee_log_printf ("\n");
|
||||
weechat_log_printf ("\n");
|
||||
channel_print_log (ptr_channel);
|
||||
|
||||
for (ptr_nick = ptr_channel->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
wee_log_printf ("\n");
|
||||
weechat_log_printf ("\n");
|
||||
nick_print_log (ptr_nick);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
wee_log_printf ("\n");
|
||||
wee_log_printf ("[windows/buffers]\n");
|
||||
wee_log_printf (" => windows:\n");
|
||||
weechat_log_printf ("\n");
|
||||
for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
|
||||
{
|
||||
dcc_print_log (ptr_dcc);
|
||||
}
|
||||
|
||||
weechat_log_printf ("\n");
|
||||
weechat_log_printf ("[windows/buffers]\n");
|
||||
weechat_log_printf (" => windows:\n");
|
||||
for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window)
|
||||
{
|
||||
wee_log_printf (" 0x%X\n", ptr_window);
|
||||
weechat_log_printf (" 0x%X\n", ptr_window);
|
||||
}
|
||||
wee_log_printf (" => buffers:\n");
|
||||
weechat_log_printf (" => buffers:\n");
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
wee_log_printf (" 0x%X\n", ptr_buffer);
|
||||
weechat_log_printf (" 0x%X\n", ptr_buffer);
|
||||
}
|
||||
wee_log_printf (" => current window = 0x%X\n", gui_current_window);
|
||||
weechat_log_printf (" => current window = 0x%X\n", gui_current_window);
|
||||
|
||||
for (ptr_window = gui_windows; ptr_window; ptr_window = ptr_window->next_window)
|
||||
{
|
||||
wee_log_printf ("\n");
|
||||
weechat_log_printf ("\n");
|
||||
gui_window_print_log (ptr_window);
|
||||
}
|
||||
|
||||
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
|
||||
{
|
||||
wee_log_printf ("\n");
|
||||
weechat_log_printf ("\n");
|
||||
gui_buffer_print_log (ptr_buffer);
|
||||
}
|
||||
|
||||
wee_log_printf ("\n");
|
||||
weechat_log_printf ("\n");
|
||||
ignore_print_log ();
|
||||
|
||||
wee_log_printf ("\n");
|
||||
wee_log_printf ("****** End of dump ******\n");
|
||||
wee_log_printf ("\n");
|
||||
weechat_log_printf ("\n");
|
||||
weechat_log_printf ("****** End of dump ******\n");
|
||||
weechat_log_printf ("\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* my_sigsegv: SIGSEGV handler: save crash log to ~/.weechat/weechat.log and exit
|
||||
* weechat_sigsegv: SIGSEGV handler: save crash log to ~/.weechat/weechat.log and exit
|
||||
*/
|
||||
|
||||
void
|
||||
my_sigsegv ()
|
||||
weechat_sigsegv ()
|
||||
{
|
||||
wee_dump (1);
|
||||
wee_gui_shutdown ();
|
||||
weechat_dump (1);
|
||||
dcc_end ();
|
||||
server_free_all ();
|
||||
gui_end ();
|
||||
fprintf (stderr, "\n");
|
||||
fprintf (stderr, "*** Very bad! WeeChat has crashed (SIGSEGV received)\n");
|
||||
fprintf (stderr, "*** Full crash dump was saved to ~/.weechat/weechat.log file\n");
|
||||
fprintf (stderr, "*** Please send this file to WeeChat developers.\n");
|
||||
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
|
||||
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
|
||||
wee_shutdown (EXIT_FAILURE, 1);
|
||||
weechat_shutdown (EXIT_FAILURE, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -878,63 +947,53 @@ my_sigsegv ()
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
#ifdef ENABLE_NLS
|
||||
setlocale (LC_ALL, ""); /* initialize gettext */
|
||||
#ifdef ENABLE_NLS
|
||||
setlocale (LC_ALL, ""); /* initialize gettext */
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LANGINFO_CODESET
|
||||
local_charset = strdup (nl_langinfo (CODESET));
|
||||
#endif
|
||||
|
||||
signal (SIGINT, SIG_IGN); /* ignore SIGINT signal */
|
||||
signal (SIGQUIT, SIG_IGN); /* ignore SIGQUIT signal */
|
||||
signal (SIGPIPE, SIG_IGN); /* ignore SIGPIPE signal */
|
||||
signal (SIGSEGV, my_sigsegv); /* crash dump when SIGSEGV is received */
|
||||
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */
|
||||
wee_init_vars (); /* initialize some variables */
|
||||
gui_key_init (); /* init keyboard (default key bindings) */
|
||||
wee_parse_args (argc, argv); /* parse command line args */
|
||||
wee_create_home_dirs (); /* create WeeChat directories */
|
||||
wee_init_log (); /* init log file */
|
||||
command_index_build (); /* build commands index for completion */
|
||||
|
||||
switch (config_read ()) /* read configuration */
|
||||
{
|
||||
case 0: /* config file OK */
|
||||
break;
|
||||
case -1: /* config file not found */
|
||||
if (config_create_default () < 0)
|
||||
return EXIT_FAILURE;
|
||||
if (config_read () != 0)
|
||||
return EXIT_FAILURE;
|
||||
break;
|
||||
default: /* other error (fatal) */
|
||||
server_free_all ();
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
utf8_init (); /* init UTF-8 in WeeChat */
|
||||
gui_init (); /* init WeeChat interface */
|
||||
weechat_welcome_message (); /* display WeeChat welcome message */
|
||||
#ifdef PLUGINS
|
||||
plugin_init (auto_load_plugins);/* init plugin interface(s) */
|
||||
#endif
|
||||
/* auto-connect to servers */
|
||||
server_auto_connect (auto_connect, server_cmd_line);
|
||||
fifo_create (); /* create FIFO pipe for remote control */
|
||||
|
||||
gui_main_loop (); /* WeeChat main loop */
|
||||
#ifdef HAVE_LANGINFO_CODESET
|
||||
local_charset = strdup (nl_langinfo (CODESET));
|
||||
#endif
|
||||
|
||||
signal (SIGINT, SIG_IGN); /* ignore SIGINT signal */
|
||||
signal (SIGQUIT, SIG_IGN); /* ignore SIGQUIT signal */
|
||||
signal (SIGPIPE, SIG_IGN); /* ignore SIGPIPE signal */
|
||||
signal (SIGSEGV, weechat_sigsegv); /* crash dump when SIGSEGV received */
|
||||
gui_pre_init (&argc, &argv); /* pre-initiliaze interface */
|
||||
weechat_init_vars (); /* initialize some variables */
|
||||
gui_key_init (); /* init keyb. (default key bindings)*/
|
||||
weechat_parse_args (argc, argv); /* parse command line args */
|
||||
weechat_create_home_dirs (); /* create WeeChat directories */
|
||||
weechat_init_log (); /* init log file */
|
||||
command_index_build (); /* build cmd index for completion */
|
||||
weechat_config_read (); /* read configuration */
|
||||
utf8_init (); /* init UTF-8 in WeeChat */
|
||||
gui_init (); /* init WeeChat interface */
|
||||
weechat_welcome_message (); /* display WeeChat welcome message */
|
||||
fifo_create (); /* FIFO pipe for remote control */
|
||||
if (weechat_session)
|
||||
session_load (weechat_session); /* load previous session if asked */
|
||||
#ifdef PLUGINS
|
||||
plugin_init (auto_load_plugins); /* init plugin interface(s) */
|
||||
#endif
|
||||
|
||||
server_auto_connect (auto_connect, /* auto-connect to servers */
|
||||
server_cmd_line);
|
||||
|
||||
gui_main_loop (); /* WeeChat main loop */
|
||||
|
||||
#ifdef PLUGINS
|
||||
plugin_end (); /* end plugin interface(s) */
|
||||
plugin_end (); /* end plugin interface(s) */
|
||||
#endif
|
||||
server_disconnect_all (); /* disconnect from all servers */
|
||||
(void) config_write (NULL); /* save config file */
|
||||
command_index_free (); /* free commands index */
|
||||
wee_gui_shutdown (); /* shut down WeeChat GUI */
|
||||
wee_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */
|
||||
server_disconnect_all (); /* disconnect from all servers */
|
||||
(void) config_write (NULL); /* save config file */
|
||||
command_index_free (); /* free commands index */
|
||||
dcc_end (); /* remove all DCC */
|
||||
server_free_all (); /* free all servers */
|
||||
gui_end (); /* shut down WeeChat GUI */
|
||||
weechat_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */
|
||||
|
||||
return EXIT_SUCCESS; /* make gcc happy (never executed) */
|
||||
return EXIT_SUCCESS; /* make gcc happy (never executed) */
|
||||
}
|
||||
|
||||
+11
-27
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define WEECHAT_COPYRIGHT_DATE "(c) 2003-2005"
|
||||
#define WEECHAT_COPYRIGHT_DATE "(c) 2003-2006"
|
||||
#define WEECHAT_WEBSITE "http://weechat.flashtux.org"
|
||||
|
||||
#define WEECHAT_ERROR _("WeeChat Error:")
|
||||
@@ -65,7 +65,7 @@
|
||||
/* license */
|
||||
|
||||
#define WEE_LICENSE \
|
||||
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
|
||||
PACKAGE_STRING " (c) Copyright 2003-2006, compiled on " __DATE__ " " __TIME__ \
|
||||
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
|
||||
"This program is free software; you can redistribute it and/or modify\n" \
|
||||
"it under the terms of the GNU General Public License as published by\n" \
|
||||
@@ -80,26 +80,8 @@
|
||||
"\n" \
|
||||
"You should have received a copy of the GNU General Public License\n" \
|
||||
"along with this program; if not, write to the Free Software\n" \
|
||||
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\n"
|
||||
"Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n\n"
|
||||
|
||||
#define WEE_USAGE1 \
|
||||
PACKAGE_STRING " (c) Copyright 2003-2005, compiled on " __DATE__ " " __TIME__ \
|
||||
"\nDeveloped by FlashCode <flashcode@flashtux.org> - " WEECHAT_WEBSITE "\n\n" \
|
||||
"Usage: %s [options ...]\n" \
|
||||
" or: %s [irc[6][s]://[nickname[:password]@]irc.example.org[:port][/channel][,channel[...]]\n\n"
|
||||
|
||||
#define WEE_USAGE2 \
|
||||
" -a, --no-connect disable auto-connect to servers at startup\n" \
|
||||
" -c, --config display config file options\n" \
|
||||
" -f, --key-functions display WeeChat internal functions for keys\n" \
|
||||
" -h, --help this help\n" \
|
||||
" -i, --irc-commands display IRC commands\n" \
|
||||
" -k, --keys display WeeChat default keys\n" \
|
||||
" -l, --license display WeeChat license\n" \
|
||||
" -p, --no-plugin don't load any plugin at startup\n" \
|
||||
" -v, --version display WeeChat version\n" \
|
||||
" -w, --weechat-commands display WeeChat commands\n\n"
|
||||
|
||||
/* directory separator, depending on OS */
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -112,9 +94,11 @@
|
||||
|
||||
/* global variables and functions */
|
||||
|
||||
extern char *weechat_argv0;
|
||||
extern time_t weechat_start_time;
|
||||
extern int quit_weechat;
|
||||
extern char *weechat_home;
|
||||
extern FILE *weechat_log_file;
|
||||
extern char *local_charset;
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
@@ -123,10 +107,10 @@ extern gnutls_certificate_credentials gnutls_xcred;
|
||||
|
||||
extern int ascii_strcasecmp (char *, char *);
|
||||
extern int ascii_strncasecmp (char *, char *, int);
|
||||
extern void wee_log_printf (char *, ...);
|
||||
extern void wee_dump (int);
|
||||
extern char *weechat_convert_encoding (char *, char *, char *);
|
||||
extern void weechat_log_printf (char *, ...);
|
||||
extern void weechat_dump (int);
|
||||
extern char *weechat_iconv (char *, char *, char *);
|
||||
extern long get_timeval_diff (struct timeval *, struct timeval *);
|
||||
extern void wee_shutdown (int, int);
|
||||
extern void weechat_shutdown (int, int);
|
||||
|
||||
#endif /* weechat.h */
|
||||
|
||||
+332
-118
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* weeconfig.c: WeeChat configuration */
|
||||
@@ -74,7 +74,6 @@ char *cfg_look_charset_encode;
|
||||
char *cfg_look_charset_internal;
|
||||
int cfg_look_one_server_buffer;
|
||||
char *cfg_look_buffer_timestamp;
|
||||
int cfg_look_color_nicks;
|
||||
int cfg_look_color_nicks_number;
|
||||
int cfg_look_color_actions;
|
||||
int cfg_look_nicklist;
|
||||
@@ -97,10 +96,11 @@ int cfg_look_hotlist_names_level;
|
||||
int cfg_look_hotlist_names_length;
|
||||
int cfg_look_day_change;
|
||||
char *cfg_look_day_change_timestamp;
|
||||
char *cfg_look_read_marker;
|
||||
|
||||
t_config_option weechat_options_look[] =
|
||||
{ { "look_set_title", N_("set title for window (terminal for Curses GUI) with name & version"),
|
||||
N_("set title for window (terminal for Curses GUI) with name & version"),
|
||||
{ { "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 },
|
||||
{ "look_startup_logo", N_("display WeeChat logo at startup"),
|
||||
@@ -141,10 +141,6 @@ t_config_option weechat_options_look[] =
|
||||
N_("timestamp for buffers"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"[%H:%M:%S]", NULL, NULL, &cfg_look_buffer_timestamp, config_change_buffer_content },
|
||||
{ "look_color_nicks", N_("display nick names with different colors"),
|
||||
N_("display nick names with different colors"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_look_color_nicks, NULL, config_change_noop },
|
||||
{ "look_color_nicks_number", N_("number of colors to use for nicks colors"),
|
||||
N_("number of colors to use for nicks colors"),
|
||||
OPTION_TYPE_INT, 1, 10, 10,
|
||||
@@ -190,7 +186,7 @@ t_config_option weechat_options_look[] =
|
||||
{ "look_nick_completion_ignore", N_("chars ignored for nick completion"),
|
||||
N_("chars ignored for nick completion"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"[]-", NULL, NULL, &cfg_look_nick_completion_ignore, config_change_noop },
|
||||
"[]-^", NULL, NULL, &cfg_look_nick_completion_ignore, config_change_noop },
|
||||
{ "look_infobar", N_("enable info bar"),
|
||||
N_("enable info bar"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
@@ -229,12 +225,17 @@ t_config_option weechat_options_look[] =
|
||||
N_("timestamp for date displayed when day changed"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"%a, %d %b %Y", NULL, NULL, &cfg_look_day_change_timestamp, config_change_noop },
|
||||
{ "look_read_marker", N_("use a marker on servers/channels to show first unread line"),
|
||||
N_("use a marker on servers/channels to show first unread line"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
" ", NULL, NULL, &cfg_look_read_marker, config_change_read_marker},
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
/* config, colors section */
|
||||
|
||||
int cfg_col_real_white;
|
||||
int cfg_col_separator;
|
||||
int cfg_col_title;
|
||||
int cfg_col_title_bg;
|
||||
int cfg_col_chat;
|
||||
@@ -251,6 +252,8 @@ int cfg_col_chat_channel;
|
||||
int cfg_col_chat_dark;
|
||||
int cfg_col_chat_highlight;
|
||||
int cfg_col_chat_bg;
|
||||
int cfg_col_chat_read_marker;
|
||||
int cfg_col_chat_read_marker_bg;
|
||||
int cfg_col_status;
|
||||
int cfg_col_status_delimiters;
|
||||
int cfg_col_status_channel;
|
||||
@@ -298,6 +301,10 @@ t_config_option weechat_options_colors[] =
|
||||
"this option to see real white instead of default term foreground color)"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
|
||||
NULL, NULL, &cfg_col_real_white, NULL, config_change_color },
|
||||
{ "col_separator", N_("color for window separators (when splited)"),
|
||||
N_("color for window separators (when splited)"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"blue", NULL, &cfg_col_separator, NULL, &config_change_color },
|
||||
/* title window */
|
||||
{ "col_title", N_("color for title bar"),
|
||||
N_("color for title bar"),
|
||||
@@ -365,6 +372,14 @@ t_config_option weechat_options_colors[] =
|
||||
N_("background for chat window"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"default", NULL, &cfg_col_chat_bg, NULL, &config_change_color },
|
||||
{ "col_chat_read_marker", N_("color for unread data marker"),
|
||||
N_("color for unread data marker"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"yellow", NULL, &cfg_col_chat_read_marker, NULL, &config_change_color },
|
||||
{ "col_chat_read_marker_bg", N_("background for unread data marker"),
|
||||
N_("background for unread data marker"),
|
||||
OPTION_TYPE_COLOR, 0, 0, 0,
|
||||
"magenta", NULL, &cfg_col_chat_read_marker_bg, NULL, &config_change_color },
|
||||
|
||||
/* status window */
|
||||
{ "col_status", N_("color for status bar"),
|
||||
@@ -571,6 +586,7 @@ t_config_option weechat_options_colors[] =
|
||||
|
||||
int cfg_history_max_lines;
|
||||
int cfg_history_max_commands;
|
||||
int cfg_history_display_default;
|
||||
|
||||
t_config_option weechat_options_history[] =
|
||||
{ { "history_max_lines", N_("max lines in history (per window)"),
|
||||
@@ -582,6 +598,10 @@ t_config_option weechat_options_history[] =
|
||||
N_("maximum number of user commands in history (0 = unlimited)"),
|
||||
OPTION_TYPE_INT, 0, INT_MAX, 100,
|
||||
NULL, NULL, &cfg_history_max_commands, NULL, &config_change_noop },
|
||||
{ "history_display_default", N_("max commands to display"),
|
||||
N_("maximum number of commands to display by default in history listing (0 = unlimited)"),
|
||||
OPTION_TYPE_INT, 0, INT_MAX, 5,
|
||||
NULL, NULL, &cfg_history_display_default, NULL, &config_change_noop },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -630,7 +650,8 @@ t_config_option weechat_options_log[] =
|
||||
/* config, irc section */
|
||||
|
||||
int cfg_irc_display_away;
|
||||
char *cfg_irc_default_msg_away;
|
||||
char *cfg_irc_display_away_values[] =
|
||||
{ "off", "local", "channel", NULL };
|
||||
char *cfg_irc_default_msg_part;
|
||||
char *cfg_irc_default_msg_quit;
|
||||
int cfg_irc_notice_as_pv;
|
||||
@@ -644,14 +665,10 @@ int cfg_irc_colors_receive;
|
||||
int cfg_irc_colors_send;
|
||||
|
||||
t_config_option weechat_options_irc[] =
|
||||
{ { "irc_display_away", N_("display message to all channels when away"),
|
||||
N_("display message to all channels when (un)marking as away"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
NULL, NULL, &cfg_irc_display_away, NULL, &config_change_noop },
|
||||
{ "irc_default_msg_away", N_("default message when away"),
|
||||
N_("default message when away"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"away", NULL, NULL, &cfg_irc_default_msg_away, &config_change_noop },
|
||||
{ { "irc_display_away", N_("display message for away"),
|
||||
N_("display message when (un)marking as away"),
|
||||
OPTION_TYPE_INT_WITH_STRING, 0, 0, 0,
|
||||
"off", cfg_irc_display_away_values, &cfg_irc_display_away, NULL, &config_change_noop },
|
||||
{ "irc_default_msg_part", N_("default part message (leaving channel)"),
|
||||
N_("default part message (leaving channel)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
@@ -922,6 +939,21 @@ t_config_option weechat_options_server[] =
|
||||
N_("comma separated list of notify levels for channels of this server (format: #channel:1,..)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.notify_levels), config_change_notify_levels },
|
||||
{ "server_charset_decode_iso", N_("charset for decoding ISO on server and channels"),
|
||||
N_("comma separated list of charsets for server and channels, "
|
||||
"to decode ISO (format: server:charset,#channel:charset,..)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.charset_decode_iso), config_change_noop },
|
||||
{ "server_charset_decode_utf", N_("charset for decoding UTF on server and channels"),
|
||||
N_("comma separated list of charsets for server and channels, "
|
||||
"to decode UTF (format: server:charset,#channel:charset,..)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.charset_decode_utf), config_change_noop },
|
||||
{ "server_charset_encode", N_("charset for encoding messages on server and channels"),
|
||||
N_("comma separated list of charsets for server and channels, "
|
||||
"to encode messages (format: server:charset,#channel:charset,..)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &(cfg_server.charset_encode), config_change_noop },
|
||||
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@@ -936,12 +968,12 @@ t_config_option *weechat_options[CONFIG_NUMBER_SECTIONS] =
|
||||
|
||||
|
||||
/*
|
||||
* get_pos_array_values: returns position of a string in an array of values
|
||||
* returns -1 if not found, otherwise position
|
||||
* config_get_pos_array_values: return position of a string in an array of values
|
||||
* return -1 if not found, otherwise position
|
||||
*/
|
||||
|
||||
int
|
||||
get_pos_array_values (char **array, char *string)
|
||||
config_get_pos_array_values (char **array, char *string)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1000,7 +1032,10 @@ config_change_noop ()
|
||||
void
|
||||
config_change_title ()
|
||||
{
|
||||
gui_set_window_title ();
|
||||
if (cfg_look_set_title)
|
||||
gui_set_window_title ();
|
||||
else
|
||||
gui_reset_window_title ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1024,6 +1059,19 @@ config_change_buffer_content ()
|
||||
gui_redraw_buffer (gui_current_window->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* config_change_read_marker: called when read marker is changed
|
||||
*/
|
||||
|
||||
void
|
||||
config_change_read_marker ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
gui_redraw_buffer (ptr_win->buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* config_change_charset: called when charset changes
|
||||
*/
|
||||
@@ -1056,12 +1104,9 @@ config_change_one_server_buffer ()
|
||||
void
|
||||
config_change_color ()
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
gui_init_color_pairs ();
|
||||
gui_rebuild_weechat_colors ();
|
||||
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
|
||||
gui_redraw_buffer (ptr_win->buffer);
|
||||
gui_refresh_windows ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1209,7 +1254,8 @@ config_option_set_value (t_config_option *option, char *value)
|
||||
*(option->ptr_int) = int_value;
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
int_value = get_pos_array_values (option->array_values, value);
|
||||
int_value = config_get_pos_array_values (option->array_values,
|
||||
value);
|
||||
if (int_value < 0)
|
||||
return -1;
|
||||
*(option->ptr_int) = int_value;
|
||||
@@ -1227,6 +1273,116 @@ config_option_set_value (t_config_option *option, char *value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* config_option_list_remove: remove an item from a list for an option
|
||||
* (for options with value like: "abc:1,def:blabla")
|
||||
*/
|
||||
|
||||
void
|
||||
config_option_list_remove (char **string, char *item)
|
||||
{
|
||||
char *name, *pos, *pos2;
|
||||
|
||||
if (!string || !(*string))
|
||||
return;
|
||||
|
||||
name = (char *) malloc (strlen (item) + 2);
|
||||
strcpy (name, item);
|
||||
strcat (name, ":");
|
||||
pos = strstr (*string, name);
|
||||
free (name);
|
||||
if (pos)
|
||||
{
|
||||
pos2 = pos + strlen (item);
|
||||
if (pos2[0] == ':')
|
||||
{
|
||||
pos2++;
|
||||
if (pos2[0])
|
||||
{
|
||||
while (pos2[0] && (pos2[0] != ','))
|
||||
pos2++;
|
||||
if (pos2[0] == ',')
|
||||
pos2++;
|
||||
if (!pos2[0] && (pos != (*string)))
|
||||
pos--;
|
||||
strcpy (pos, pos2);
|
||||
if (!(*string)[0])
|
||||
{
|
||||
free (*string);
|
||||
*string = NULL;
|
||||
}
|
||||
else
|
||||
(*string) = (char *) realloc (*string, strlen (*string) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* config_option_list_set: set an item from a list for an option
|
||||
* (for options with value like: "abc:1,def:blabla")
|
||||
*/
|
||||
|
||||
void
|
||||
config_option_list_set (char **string, char *item, char *value)
|
||||
{
|
||||
config_option_list_remove (string, item);
|
||||
|
||||
if (!(*string))
|
||||
{
|
||||
(*string) = (char *) malloc (strlen (item) + 1 + strlen (value) + 1);
|
||||
(*string)[0] = '\0';
|
||||
}
|
||||
else
|
||||
(*string) = (char *) realloc (*string,
|
||||
strlen (*string) + 1 +
|
||||
strlen (item) + 1 + strlen (value) + 1);
|
||||
|
||||
if ((*string)[0])
|
||||
strcat (*string, ",");
|
||||
strcat (*string, item);
|
||||
strcat (*string, ":");
|
||||
strcat (*string, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* config_option_list_get_value: return position of item value in the list
|
||||
* (for options with value like: "abc:1,def:blabla")
|
||||
*/
|
||||
|
||||
void
|
||||
config_option_list_get_value (char **string, char *item,
|
||||
char **pos_found, int *length)
|
||||
{
|
||||
char *name, *pos, *pos2, *pos_comma;
|
||||
|
||||
*pos_found = NULL;
|
||||
*length = 0;
|
||||
|
||||
if (!string || !(*string))
|
||||
return;
|
||||
|
||||
name = (char *) malloc (strlen (item) + 2);
|
||||
strcpy (name, item);
|
||||
strcat (name, ":");
|
||||
pos = strstr (*string, name);
|
||||
free (name);
|
||||
if (pos)
|
||||
{
|
||||
pos2 = pos + strlen (item);
|
||||
if (pos2[0] == ':')
|
||||
{
|
||||
pos2++;
|
||||
*pos_found = pos2;
|
||||
pos_comma = strchr (pos2, ',');
|
||||
if (pos_comma)
|
||||
*length = pos_comma - pos2;
|
||||
else
|
||||
*length = strlen (pos2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* config_get_server_option_ptr: get a pointer to a server config option
|
||||
*/
|
||||
@@ -1272,6 +1428,12 @@ config_get_server_option_ptr (t_irc_server *server, char *option_name)
|
||||
return (void *)(&server->autorejoin);
|
||||
if (ascii_strcasecmp (option_name, "server_notify_levels") == 0)
|
||||
return (void *)(&server->notify_levels);
|
||||
if (ascii_strcasecmp (option_name, "server_charset_decode_iso") == 0)
|
||||
return (void *)(&server->charset_decode_iso);
|
||||
if (ascii_strcasecmp (option_name, "server_charset_decode_utf") == 0)
|
||||
return (void *)(&server->charset_decode_utf);
|
||||
if (ascii_strcasecmp (option_name, "server_charset_encode") == 0)
|
||||
return (void *)(&server->charset_encode);
|
||||
/* option not found */
|
||||
return NULL;
|
||||
}
|
||||
@@ -1326,7 +1488,8 @@ config_set_server_value (t_irc_server *server, char *option_name,
|
||||
*((int *)(ptr_data)) = int_value;
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
int_value = get_pos_array_values (ptr_option->array_values, value);
|
||||
int_value = config_get_pos_array_values (ptr_option->array_values,
|
||||
value);
|
||||
if (int_value < 0)
|
||||
return -2;
|
||||
*((int *)(ptr_data)) = int_value;
|
||||
@@ -1496,7 +1659,9 @@ config_allocate_server (char *filename, int line_number)
|
||||
cfg_server.password, cfg_server.nick1, cfg_server.nick2,
|
||||
cfg_server.nick3, cfg_server.username, cfg_server.realname,
|
||||
cfg_server.command, cfg_server.command_delay, cfg_server.autojoin,
|
||||
cfg_server.autorejoin, cfg_server.notify_levels))
|
||||
cfg_server.autorejoin, cfg_server.notify_levels,
|
||||
cfg_server.charset_decode_iso, cfg_server.charset_decode_utf,
|
||||
cfg_server.charset_encode))
|
||||
{
|
||||
server_free_all ();
|
||||
gui_printf (NULL,
|
||||
@@ -1535,7 +1700,7 @@ config_default_values ()
|
||||
weechat_options[i][j].default_int;
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
int_value = get_pos_array_values (
|
||||
int_value = config_get_pos_array_values (
|
||||
weechat_options[i][j].array_values,
|
||||
weechat_options[i][j].default_string);
|
||||
if (int_value < 0)
|
||||
@@ -1581,10 +1746,8 @@ config_read ()
|
||||
int server_found;
|
||||
char line[1024], *ptr_line, *pos, *pos2;
|
||||
|
||||
filename_length = strlen (weechat_home) +
|
||||
strlen (WEECHAT_CONFIG_NAME) + 2;
|
||||
filename =
|
||||
(char *) malloc (filename_length * sizeof (char));
|
||||
filename_length = strlen (weechat_home) + strlen (WEECHAT_CONFIG_NAME) + 2;
|
||||
filename = (char *) malloc (filename_length * sizeof (char));
|
||||
if (!filename)
|
||||
return -2;
|
||||
snprintf (filename, filename_length, "%s%s" WEECHAT_CONFIG_NAME,
|
||||
@@ -1672,6 +1835,22 @@ config_read ()
|
||||
{
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
|
||||
/* remove spaces before '=' */
|
||||
pos2 = pos - 2;
|
||||
while ((pos2 > line) && (pos2[0] == ' '))
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2--;
|
||||
}
|
||||
|
||||
/* skip spaces after '=' */
|
||||
while (pos[0] && (pos[0] == ' '))
|
||||
{
|
||||
pos++;
|
||||
}
|
||||
|
||||
/* remove CR/LF */
|
||||
pos2 = strchr (pos, '\r');
|
||||
if (pos2 != NULL)
|
||||
pos2[0] = '\0';
|
||||
@@ -1679,6 +1858,27 @@ config_read ()
|
||||
if (pos2 != NULL)
|
||||
pos2[0] = '\0';
|
||||
|
||||
/* remove simple or double quotes
|
||||
and spaces at the end */
|
||||
if (strlen(pos) > 1)
|
||||
{
|
||||
pos2 = pos + strlen (pos) - 1;
|
||||
while ((pos2 > pos) && (pos2[0] == ' '))
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos2--;
|
||||
}
|
||||
pos2 = pos + strlen (pos) - 1;
|
||||
if (((pos[0] == '\'') &&
|
||||
(pos2[0] == '\'')) ||
|
||||
((pos[0] == '"') &&
|
||||
(pos2[0] == '"')))
|
||||
{
|
||||
pos2[0] = '\0';
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
if (section == CONFIG_SECTION_KEYS)
|
||||
{
|
||||
if (pos[0])
|
||||
@@ -1846,7 +2046,7 @@ config_create_default ()
|
||||
}
|
||||
|
||||
printf (_("%s: creating default config file...\n"), PACKAGE_NAME);
|
||||
wee_log_printf (_("Creating default config file\n"));
|
||||
weechat_log_printf (_("Creating default config file\n"));
|
||||
|
||||
current_time = time (NULL);
|
||||
fprintf (file, _("#\n# %s configuration file, created by "
|
||||
@@ -1867,20 +2067,24 @@ config_create_default ()
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].default_int) ?
|
||||
"on" : "off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
fprintf (file, "%s=%d\n",
|
||||
fprintf (file, "%s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].default_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
case OPTION_TYPE_COLOR:
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].default_string);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
weechat_options[i][j].option_name,
|
||||
weechat_options[i][j].default_string);
|
||||
break;
|
||||
@@ -1898,12 +2102,12 @@ config_create_default ()
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
}
|
||||
else
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
ptr_key->command);
|
||||
if (expanded_name)
|
||||
@@ -1912,64 +2116,64 @@ config_create_default ()
|
||||
|
||||
/* default aliases */
|
||||
fprintf (file, "\n[alias]\n");
|
||||
fprintf (file, "SAY=msg *\n");
|
||||
fprintf (file, "BYE=quit\n");
|
||||
fprintf (file, "EXIT=quit\n");
|
||||
fprintf (file, "SIGNOFF=quit\n");
|
||||
fprintf (file, "C=clear\n");
|
||||
fprintf (file, "CL=clear\n");
|
||||
fprintf (file, "CLOSE=buffer close\n");
|
||||
fprintf (file, "CHAT=dcc chat\n");
|
||||
fprintf (file, "IG=ignore\n");
|
||||
fprintf (file, "J=join\n");
|
||||
fprintf (file, "K=kick\n");
|
||||
fprintf (file, "KB=kickban\n");
|
||||
fprintf (file, "LEAVE=part\n");
|
||||
fprintf (file, "M=msg\n");
|
||||
fprintf (file, "MUB=unban *\n");
|
||||
fprintf (file, "N=names\n");
|
||||
fprintf (file, "Q=query\n");
|
||||
fprintf (file, "T=topic\n");
|
||||
fprintf (file, "UB=unban\n");
|
||||
fprintf (file, "UNIG=unignore\n");
|
||||
fprintf (file, "W=who\n");
|
||||
fprintf (file, "WC=part\n");
|
||||
fprintf (file, "WI=whois\n");
|
||||
fprintf (file, "WW=whowas\n");
|
||||
fprintf (file, "SAY = \"msg *\"\n");
|
||||
fprintf (file, "BYE = \"quit\"\n");
|
||||
fprintf (file, "EXIT = \"quit\"\n");
|
||||
fprintf (file, "SIGNOFF = \"quit\"\n");
|
||||
fprintf (file, "C = \"clear\"\n");
|
||||
fprintf (file, "CL = \"clear\"\n");
|
||||
fprintf (file, "CLOSE = \"buffer close\"\n");
|
||||
fprintf (file, "CHAT = \"dcc chat\"\n");
|
||||
fprintf (file, "IG = \"ignore\"\n");
|
||||
fprintf (file, "J = \"join\"\n");
|
||||
fprintf (file, "K = \"kick\"\n");
|
||||
fprintf (file, "KB = \"kickban\"\n");
|
||||
fprintf (file, "LEAVE = \"part\"\n");
|
||||
fprintf (file, "M = \"msg\"\n");
|
||||
fprintf (file, "MUB = \"unban *\"\n");
|
||||
fprintf (file, "N = \"names\"\n");
|
||||
fprintf (file, "Q = \"query\"\n");
|
||||
fprintf (file, "T = \"topic\"\n");
|
||||
fprintf (file, "UB = \"unban\"\n");
|
||||
fprintf (file, "UNIG = \"unignore\"\n");
|
||||
fprintf (file, "W = \"who\"\n");
|
||||
fprintf (file, "WC = \"part\"\n");
|
||||
fprintf (file, "WI = \"whois\"\n");
|
||||
fprintf (file, "WW = \"whowas\"\n");
|
||||
|
||||
/* no ignore by default */
|
||||
|
||||
/* default server is freenode */
|
||||
fprintf (file, "\n[server]\n");
|
||||
fprintf (file, "server_name=freenode\n");
|
||||
fprintf (file, "server_autoconnect=on\n");
|
||||
fprintf (file, "server_autoreconnect=on\n");
|
||||
fprintf (file, "server_autoreconnect_delay=30\n");
|
||||
fprintf (file, "server_address=irc.freenode.net\n");
|
||||
fprintf (file, "server_port=6667\n");
|
||||
fprintf (file, "server_ipv6=off\n");
|
||||
fprintf (file, "server_ssl=off\n");
|
||||
fprintf (file, "server_password=\n");
|
||||
fprintf (file, "server_name = \"freenode\"\n");
|
||||
fprintf (file, "server_autoconnect = on\n");
|
||||
fprintf (file, "server_autoreconnect = on\n");
|
||||
fprintf (file, "server_autoreconnect_delay = 30\n");
|
||||
fprintf (file, "server_address = \"irc.freenode.net\"\n");
|
||||
fprintf (file, "server_port = 6667\n");
|
||||
fprintf (file, "server_ipv6 = off\n");
|
||||
fprintf (file, "server_ssl = off\n");
|
||||
fprintf (file, "server_password = \"\"\n");
|
||||
|
||||
/* Get the user's name from /etc/passwd */
|
||||
if ((my_passwd = getpwuid (geteuid ())) != NULL)
|
||||
{
|
||||
fprintf (file, "server_nick1=%s\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_nick2=%s1\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_nick3=%s2\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_username=%s\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_nick1 = \"%s\"\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_nick2 = \"%s1\"\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_nick3 = \"%s2\"\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_username = \"%s\"\n", my_passwd->pw_name);
|
||||
if ((!my_passwd->pw_gecos)
|
||||
|| (my_passwd->pw_gecos[0] == '\0')
|
||||
|| (my_passwd->pw_gecos[0] == ',')
|
||||
|| (my_passwd->pw_gecos[0] == ' '))
|
||||
fprintf (file, "server_realname=%s\n", my_passwd->pw_name);
|
||||
fprintf (file, "server_realname = \"%s\"\n", my_passwd->pw_name);
|
||||
else
|
||||
{
|
||||
realname = strdup (my_passwd->pw_gecos);
|
||||
pos = strchr (realname, ',');
|
||||
if (pos)
|
||||
pos[0] = '\0';
|
||||
fprintf (file, "server_realname=%s\n",
|
||||
fprintf (file, "server_realname = \"%s\"\n",
|
||||
realname);
|
||||
if (pos)
|
||||
pos[0] = ',';
|
||||
@@ -1983,17 +2187,21 @@ config_create_default ()
|
||||
WEECHAT_WARNING,
|
||||
_("Unable to get user's name"),
|
||||
strerror (errno));
|
||||
fprintf (file, "server_nick1=weechat1\n");
|
||||
fprintf (file, "server_nick2=weechat2\n");
|
||||
fprintf (file, "server_nick3=weechat3\n");
|
||||
fprintf (file, "server_username=weechat\n");
|
||||
fprintf (file, "server_realname=WeeChat default realname\n");
|
||||
fprintf (file, "server_nick1 = \"weechat1\"\n");
|
||||
fprintf (file, "server_nick2 = \"weechat2\"\n");
|
||||
fprintf (file, "server_nick3 = \"weechat3\"\n");
|
||||
fprintf (file, "server_username = \"weechat\"\n");
|
||||
fprintf (file, "server_realname = \"WeeChat default realname\"\n");
|
||||
}
|
||||
|
||||
fprintf (file, "server_command=\n");
|
||||
fprintf (file, "server_command_delay=0\n");
|
||||
fprintf (file, "server_autojoin=\n");
|
||||
fprintf (file, "server_autorejoin=on\n");
|
||||
fprintf (file, "server_command = \"\"\n");
|
||||
fprintf (file, "server_command_delay = 0\n");
|
||||
fprintf (file, "server_autojoin = \"\"\n");
|
||||
fprintf (file, "server_autorejoin = on\n");
|
||||
fprintf (file, "server_notify_levels = \"\"\n");
|
||||
fprintf (file, "server_charset_decode_iso = \"\"\n");
|
||||
fprintf (file, "server_charset_decode_utf = \"\"\n");
|
||||
fprintf (file, "server_charset_encode = \"\"\n");
|
||||
|
||||
fclose (file);
|
||||
chmod (filename, 0600);
|
||||
@@ -2043,7 +2251,7 @@ config_write (char *config_name)
|
||||
return -1;
|
||||
}
|
||||
|
||||
wee_log_printf (_("Saving config to disk\n"));
|
||||
weechat_log_printf (_("Saving config to disk\n"));
|
||||
|
||||
current_time = time (NULL);
|
||||
fprintf (file, _("#\n# %s configuration file, created by "
|
||||
@@ -2064,35 +2272,35 @@ config_write (char *config_name)
|
||||
switch (weechat_options[i][j].option_type)
|
||||
{
|
||||
case OPTION_TYPE_BOOLEAN:
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int &&
|
||||
*weechat_options[i][j].ptr_int) ?
|
||||
"on" : "off");
|
||||
break;
|
||||
case OPTION_TYPE_INT:
|
||||
fprintf (file, "%s=%d\n",
|
||||
fprintf (file, "%s = %d\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
*weechat_options[i][j].ptr_int :
|
||||
weechat_options[i][j].default_int);
|
||||
break;
|
||||
case OPTION_TYPE_INT_WITH_STRING:
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
weechat_options[i][j].array_values[*weechat_options[i][j].ptr_int] :
|
||||
weechat_options[i][j].array_values[weechat_options[i][j].default_int]);
|
||||
break;
|
||||
case OPTION_TYPE_COLOR:
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = %s\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_int) ?
|
||||
gui_get_color_name (*weechat_options[i][j].ptr_int) :
|
||||
weechat_options[i][j].default_string);
|
||||
break;
|
||||
case OPTION_TYPE_STRING:
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
weechat_options[i][j].option_name,
|
||||
(weechat_options[i][j].ptr_string) ?
|
||||
*weechat_options[i][j].ptr_string :
|
||||
@@ -2112,12 +2320,12 @@ config_write (char *config_name)
|
||||
{
|
||||
function_name = gui_key_function_search_by_ptr (ptr_key->function);
|
||||
if (function_name)
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
function_name);
|
||||
}
|
||||
else
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
(expanded_name) ? expanded_name : ptr_key->key,
|
||||
ptr_key->command);
|
||||
if (expanded_name)
|
||||
@@ -2129,7 +2337,7 @@ config_write (char *config_name)
|
||||
for (ptr_alias = weechat_alias; ptr_alias;
|
||||
ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
fprintf (file, "%s=%s\n",
|
||||
fprintf (file, "%s = \"%s\"\n",
|
||||
ptr_alias->alias_name, ptr_alias->alias_command + 1);
|
||||
}
|
||||
|
||||
@@ -2138,7 +2346,7 @@ config_write (char *config_name)
|
||||
for (ptr_ignore = irc_ignore; ptr_ignore;
|
||||
ptr_ignore = ptr_ignore->next_ignore)
|
||||
{
|
||||
fprintf (file, "ignore=%s,%s,%s,%s\n",
|
||||
fprintf (file, "ignore = \"%s,%s,%s,%s\"\n",
|
||||
ptr_ignore->mask,
|
||||
ptr_ignore->type,
|
||||
ptr_ignore->channel_name,
|
||||
@@ -2152,35 +2360,41 @@ config_write (char *config_name)
|
||||
if (!ptr_server->command_line)
|
||||
{
|
||||
fprintf (file, "\n[server]\n");
|
||||
fprintf (file, "server_name=%s\n", ptr_server->name);
|
||||
fprintf (file, "server_autoconnect=%s\n",
|
||||
fprintf (file, "server_name = \"%s\"\n", ptr_server->name);
|
||||
fprintf (file, "server_autoconnect = %s\n",
|
||||
(ptr_server->autoconnect) ? "on" : "off");
|
||||
fprintf (file, "server_autoreconnect=%s\n",
|
||||
fprintf (file, "server_autoreconnect = %s\n",
|
||||
(ptr_server->autoreconnect) ? "on" : "off");
|
||||
fprintf (file, "server_autoreconnect_delay=%d\n",
|
||||
fprintf (file, "server_autoreconnect_delay = %d\n",
|
||||
ptr_server->autoreconnect_delay);
|
||||
fprintf (file, "server_address=%s\n", ptr_server->address);
|
||||
fprintf (file, "server_port=%d\n", ptr_server->port);
|
||||
fprintf (file, "server_ipv6=%s\n",
|
||||
fprintf (file, "server_address = \"%s\"\n", ptr_server->address);
|
||||
fprintf (file, "server_port = %d\n", ptr_server->port);
|
||||
fprintf (file, "server_ipv6 = %s\n",
|
||||
(ptr_server->ipv6) ? "on" : "off");
|
||||
fprintf (file, "server_ssl=%s\n",
|
||||
fprintf (file, "server_ssl = %s\n",
|
||||
(ptr_server->ssl) ? "on" : "off");
|
||||
fprintf (file, "server_password=%s\n",
|
||||
fprintf (file, "server_password = \"%s\"\n",
|
||||
(ptr_server->password) ? ptr_server->password : "");
|
||||
fprintf (file, "server_nick1=%s\n", ptr_server->nick1);
|
||||
fprintf (file, "server_nick2=%s\n", ptr_server->nick2);
|
||||
fprintf (file, "server_nick3=%s\n", ptr_server->nick3);
|
||||
fprintf (file, "server_username=%s\n", ptr_server->username);
|
||||
fprintf (file, "server_realname=%s\n", ptr_server->realname);
|
||||
fprintf (file, "server_command=%s\n",
|
||||
fprintf (file, "server_nick1 = \"%s\"\n", ptr_server->nick1);
|
||||
fprintf (file, "server_nick2 = \"%s\"\n", ptr_server->nick2);
|
||||
fprintf (file, "server_nick3 = \"%s\"\n", ptr_server->nick3);
|
||||
fprintf (file, "server_username = \"%s\"\n", ptr_server->username);
|
||||
fprintf (file, "server_realname = \"%s\"\n", ptr_server->realname);
|
||||
fprintf (file, "server_command = \"%s\"\n",
|
||||
(ptr_server->command) ? ptr_server->command : "");
|
||||
fprintf (file, "server_command_delay=%d\n", ptr_server->command_delay);
|
||||
fprintf (file, "server_autojoin=%s\n",
|
||||
fprintf (file, "server_command_delay = %d\n", ptr_server->command_delay);
|
||||
fprintf (file, "server_autojoin = \"%s\"\n",
|
||||
(ptr_server->autojoin) ? ptr_server->autojoin : "");
|
||||
fprintf (file, "server_autorejoin=%s\n",
|
||||
fprintf (file, "server_autorejoin = %s\n",
|
||||
(ptr_server->autorejoin) ? "on" : "off");
|
||||
fprintf (file, "server_notify_levels=%s\n",
|
||||
fprintf (file, "server_notify_levels = \"%s\"\n",
|
||||
(ptr_server->notify_levels) ? ptr_server->notify_levels : "");
|
||||
fprintf (file, "server_charset_decode_iso = \"%s\"\n",
|
||||
(ptr_server->charset_decode_iso) ? ptr_server->charset_decode_iso : "");
|
||||
fprintf (file, "server_charset_decode_utf = \"%s\"\n",
|
||||
(ptr_server->charset_decode_utf) ? ptr_server->charset_decode_utf : "");
|
||||
fprintf (file, "server_charset_encode = \"%s\"\n",
|
||||
(ptr_server->charset_encode) ? ptr_server->charset_encode : "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@
|
||||
#define CFG_LOOK_NICKLIST_TOP 2
|
||||
#define CFG_LOOK_NICKLIST_BOTTOM 3
|
||||
|
||||
#define CFG_IRC_DISPLAY_AWAY_OFF 0
|
||||
#define CFG_IRC_DISPLAY_AWAY_LOCAL 1
|
||||
#define CFG_IRC_DISPLAY_AWAY_CHANNEL 2
|
||||
|
||||
typedef struct t_config_section t_config_section;
|
||||
|
||||
struct t_config_section
|
||||
@@ -89,7 +93,6 @@ extern char *cfg_look_charset_encode;
|
||||
extern char *cfg_look_charset_internal;
|
||||
extern int cfg_look_one_server_buffer;
|
||||
extern char *cfg_look_buffer_timestamp;
|
||||
extern int cfg_look_color_nicks;
|
||||
extern int cfg_look_color_nicks_number;
|
||||
extern int cfg_look_color_actions;
|
||||
extern int cfg_look_nicklist;
|
||||
@@ -110,8 +113,10 @@ extern int cfg_look_hotlist_names_level;
|
||||
extern int cfg_look_hotlist_names_length;
|
||||
extern int cfg_look_day_change;
|
||||
extern char *cfg_look_day_change_timestamp;
|
||||
extern char *cfg_look_read_marker;
|
||||
|
||||
extern int cfg_col_real_white;
|
||||
extern int cfg_col_separator;
|
||||
extern int cfg_col_title;
|
||||
extern int cfg_col_title_bg;
|
||||
extern int cfg_col_chat;
|
||||
@@ -128,6 +133,8 @@ extern int cfg_col_chat_channel;
|
||||
extern int cfg_col_chat_dark;
|
||||
extern int cfg_col_chat_highlight;
|
||||
extern int cfg_col_chat_bg;
|
||||
extern int cfg_col_chat_read_marker;
|
||||
extern int cfg_col_chat_read_marker_bg;
|
||||
extern int cfg_col_status;
|
||||
extern int cfg_col_status_delimiters;
|
||||
extern int cfg_col_status_channel;
|
||||
@@ -169,6 +176,7 @@ extern int cfg_col_dcc_aborted;
|
||||
|
||||
extern int cfg_history_max_lines;
|
||||
extern int cfg_history_max_commands;
|
||||
extern int cfg_history_display_default;
|
||||
|
||||
extern int cfg_log_auto_server;
|
||||
extern int cfg_log_auto_channel;
|
||||
@@ -179,7 +187,6 @@ extern char *cfg_log_timestamp;
|
||||
extern int cfg_log_hide_nickserv_pwd;
|
||||
|
||||
extern int cfg_irc_display_away;
|
||||
extern char *cfg_irc_default_msg_away;
|
||||
extern char *cfg_irc_default_msg_part;
|
||||
extern char *cfg_irc_default_msg_quit;
|
||||
extern int cfg_irc_notice_as_pv;
|
||||
@@ -225,6 +232,7 @@ extern void config_change_noop ();
|
||||
extern void config_change_title ();
|
||||
extern void config_change_buffers ();
|
||||
extern void config_change_buffer_content ();
|
||||
extern void config_change_read_marker ();
|
||||
extern void config_change_charset ();
|
||||
extern void config_change_one_server_buffer ();
|
||||
extern void config_change_color ();
|
||||
@@ -234,6 +242,9 @@ extern void config_change_fifo_pipe ();
|
||||
extern void config_change_notify_levels ();
|
||||
extern void config_change_log ();
|
||||
extern int config_option_set_value (t_config_option *, char *);
|
||||
extern void config_option_list_remove (char **, char *);
|
||||
extern void config_option_list_set (char **, char *, char *);
|
||||
extern void config_option_list_get_value (char **, char *, char **, int *);
|
||||
extern t_config_option *config_option_search (char *);
|
||||
extern void config_option_search_option_value (char *, t_config_option **, void **);
|
||||
extern int config_set_value (char *, char *);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* weelist.c: sorted lists management */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
+583
-321
File diff suppressed because it is too large
Load Diff
+73
-66
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-input: user input functions for Curses GUI */
|
||||
@@ -59,71 +59,78 @@ gui_input_default_key_bindings ()
|
||||
char key_str[32], command[32];
|
||||
|
||||
/* keys binded with internal functions */
|
||||
gui_key_bind ( /* RC */ "ctrl-M", "return");
|
||||
gui_key_bind ( /* RC */ "ctrl-J", "return");
|
||||
gui_key_bind ( /* tab */ "ctrl-I", "tab");
|
||||
gui_key_bind ( /* basckp */ "ctrl-H", "backspace");
|
||||
gui_key_bind ( /* basckp */ "ctrl-?", "backspace");
|
||||
gui_key_bind ( /* del */ "meta2-3~", "delete");
|
||||
gui_key_bind ( /* ^K */ "ctrl-K", "delete_end_line");
|
||||
gui_key_bind ( /* ^U */ "ctrl-U", "delete_beginning_line");
|
||||
gui_key_bind ( /* ^W */ "ctrl-W", "delete_previous_word");
|
||||
gui_key_bind ( /* ^Y */ "ctrl-Y", "clipboard_paste");
|
||||
gui_key_bind ( /* ^T */ "ctrl-T", "transpose_chars");
|
||||
gui_key_bind ( /* home */ "meta2-1~", "home");
|
||||
gui_key_bind ( /* home */ "meta2-H", "home");
|
||||
gui_key_bind ( /* home */ "meta2-7~", "home");
|
||||
gui_key_bind ( /* ^A */ "ctrl-A", "home");
|
||||
gui_key_bind ( /* end */ "meta2-4~", "end");
|
||||
gui_key_bind ( /* end */ "meta2-F", "end");
|
||||
gui_key_bind ( /* end */ "meta2-8~", "end");
|
||||
gui_key_bind ( /* ^E */ "ctrl-E", "end");
|
||||
gui_key_bind ( /* left */ "meta2-D", "left");
|
||||
gui_key_bind ( /* right */ "meta2-C", "right");
|
||||
gui_key_bind ( /* up */ "meta2-A", "up");
|
||||
gui_key_bind ( /* ^up */ "meta-Oa", "up_global");
|
||||
gui_key_bind ( /* down */ "meta2-B", "down");
|
||||
gui_key_bind ( /* ^down */ "meta-Ob", "down_global");
|
||||
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
|
||||
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
|
||||
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
|
||||
gui_key_bind ( /* F11 */ "meta2-23~", "nick_page_up");
|
||||
gui_key_bind ( /* F12 */ "meta2-24~", "nick_page_down");
|
||||
gui_key_bind ( /* m-F11 */ "meta-meta2-1~", "nick_beginning");
|
||||
gui_key_bind ( /* m-F12 */ "meta-meta2-4~", "nick_end");
|
||||
gui_key_bind ( /* ^L */ "ctrl-L", "refresh");
|
||||
gui_key_bind ( /* m-a */ "meta-a", "jump_smart");
|
||||
gui_key_bind ( /* m-b */ "meta-b", "previous_word");
|
||||
gui_key_bind ( /* ^left */ "meta-Od", "previous_word");
|
||||
gui_key_bind ( /* m-d */ "meta-d", "delete_next_word");
|
||||
gui_key_bind ( /* m-f */ "meta-f", "next_word");
|
||||
gui_key_bind ( /* ^right */ "meta-Oc", "next_word");
|
||||
gui_key_bind ( /* m-h */ "meta-h", "hotlist_clear");
|
||||
gui_key_bind ( /* m-j,m-d */ "meta-jmeta-d", "jump_dcc");
|
||||
gui_key_bind ( /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer");
|
||||
gui_key_bind ( /* m-j,m-s */ "meta-jmeta-s", "jump_server");
|
||||
gui_key_bind ( /* m-j,m-x */ "meta-jmeta-x", "jump_next_server");
|
||||
gui_key_bind ( /* m-k */ "meta-k", "grab_key");
|
||||
gui_key_bind ( /* m-r */ "meta-r", "delete_line");
|
||||
gui_key_bind ( /* m-s */ "meta-s", "switch_server");
|
||||
gui_key_bind ( /* RC */ "ctrl-M", "return");
|
||||
gui_key_bind ( /* RC */ "ctrl-J", "return");
|
||||
gui_key_bind ( /* tab */ "ctrl-I", "tab");
|
||||
gui_key_bind ( /* basckp */ "ctrl-H", "backspace");
|
||||
gui_key_bind ( /* basckp */ "ctrl-?", "backspace");
|
||||
gui_key_bind ( /* del */ "meta2-3~", "delete");
|
||||
gui_key_bind ( /* ^K */ "ctrl-K", "delete_end_line");
|
||||
gui_key_bind ( /* ^U */ "ctrl-U", "delete_beginning_line");
|
||||
gui_key_bind ( /* ^W */ "ctrl-W", "delete_previous_word");
|
||||
gui_key_bind ( /* ^Y */ "ctrl-Y", "clipboard_paste");
|
||||
gui_key_bind ( /* ^T */ "ctrl-T", "transpose_chars");
|
||||
gui_key_bind ( /* home */ "meta2-1~", "home");
|
||||
gui_key_bind ( /* home */ "meta2-H", "home");
|
||||
gui_key_bind ( /* home */ "meta2-7~", "home");
|
||||
gui_key_bind ( /* ^A */ "ctrl-A", "home");
|
||||
gui_key_bind ( /* end */ "meta2-4~", "end");
|
||||
gui_key_bind ( /* end */ "meta2-F", "end");
|
||||
gui_key_bind ( /* end */ "meta2-8~", "end");
|
||||
gui_key_bind ( /* ^E */ "ctrl-E", "end");
|
||||
gui_key_bind ( /* left */ "meta2-D", "left");
|
||||
gui_key_bind ( /* right */ "meta2-C", "right");
|
||||
gui_key_bind ( /* up */ "meta2-A", "up");
|
||||
gui_key_bind ( /* ^up */ "meta-Oa", "up_global");
|
||||
gui_key_bind ( /* down */ "meta2-B", "down");
|
||||
gui_key_bind ( /* ^down */ "meta-Ob", "down_global");
|
||||
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
|
||||
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
|
||||
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
|
||||
gui_key_bind ( /* F11 */ "meta2-23~", "nick_page_up");
|
||||
gui_key_bind ( /* F12 */ "meta2-24~", "nick_page_down");
|
||||
gui_key_bind ( /* m-F11 */ "meta-meta2-1~", "nick_beginning");
|
||||
gui_key_bind ( /* m-F12 */ "meta-meta2-4~", "nick_end");
|
||||
gui_key_bind ( /* ^L */ "ctrl-L", "refresh");
|
||||
gui_key_bind ( /* m-a */ "meta-a", "jump_smart");
|
||||
gui_key_bind ( /* m-b */ "meta-b", "previous_word");
|
||||
gui_key_bind ( /* ^left */ "meta-Od", "previous_word");
|
||||
gui_key_bind ( /* m-d */ "meta-d", "delete_next_word");
|
||||
gui_key_bind ( /* m-f */ "meta-f", "next_word");
|
||||
gui_key_bind ( /* ^right */ "meta-Oc", "next_word");
|
||||
gui_key_bind ( /* m-h */ "meta-h", "hotlist_clear");
|
||||
gui_key_bind ( /* m-j,m-d */ "meta-jmeta-d", "jump_dcc");
|
||||
gui_key_bind ( /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer");
|
||||
gui_key_bind ( /* m-j,m-s */ "meta-jmeta-s", "jump_server");
|
||||
gui_key_bind ( /* m-j,m-x */ "meta-jmeta-x", "jump_next_server");
|
||||
gui_key_bind ( /* m-k */ "meta-k", "grab_key");
|
||||
gui_key_bind ( /* m-n */ "meta-n", "scroll_next_highlight");
|
||||
gui_key_bind ( /* m-p */ "meta-p", "scroll_previous_highlight");
|
||||
gui_key_bind ( /* m-r */ "meta-r", "delete_line");
|
||||
gui_key_bind ( /* m-s */ "meta-s", "switch_server");
|
||||
gui_key_bind ( /* m-u */ "meta-u", "scroll_unread");
|
||||
|
||||
/* keys binded with commands */
|
||||
gui_key_bind ( /* m-left */ "meta-meta2-D", "/buffer -1");
|
||||
gui_key_bind ( /* F5 */ "meta2-15~", "/buffer -1");
|
||||
gui_key_bind ( /* m-right */ "meta-meta2-C", "/buffer +1");
|
||||
gui_key_bind ( /* F6 */ "meta2-17~", "/buffer +1");
|
||||
gui_key_bind ( /* F7 */ "meta2-18~", "/window -1");
|
||||
gui_key_bind ( /* F8 */ "meta2-19~", "/window +1");
|
||||
gui_key_bind ( /* m-0 */ "meta-0", "/buffer 10");
|
||||
gui_key_bind ( /* m-1 */ "meta-1", "/buffer 1");
|
||||
gui_key_bind ( /* m-2 */ "meta-2", "/buffer 2");
|
||||
gui_key_bind ( /* m-3 */ "meta-3", "/buffer 3");
|
||||
gui_key_bind ( /* m-4 */ "meta-4", "/buffer 4");
|
||||
gui_key_bind ( /* m-5 */ "meta-5", "/buffer 5");
|
||||
gui_key_bind ( /* m-6 */ "meta-6", "/buffer 6");
|
||||
gui_key_bind ( /* m-7 */ "meta-7", "/buffer 7");
|
||||
gui_key_bind ( /* m-8 */ "meta-8", "/buffer 8");
|
||||
gui_key_bind ( /* m-9 */ "meta-9", "/buffer 9");
|
||||
gui_key_bind ( /* m-left */ "meta-meta2-D", "/buffer -1");
|
||||
gui_key_bind ( /* F5 */ "meta2-15~", "/buffer -1");
|
||||
gui_key_bind ( /* m-right */ "meta-meta2-C", "/buffer +1");
|
||||
gui_key_bind ( /* F6 */ "meta2-17~", "/buffer +1");
|
||||
gui_key_bind ( /* F7 */ "meta2-18~", "/window -1");
|
||||
gui_key_bind ( /* F8 */ "meta2-19~", "/window +1");
|
||||
gui_key_bind ( /* m-w,m-up */ "meta-wmeta-meta2-A", "/window up");
|
||||
gui_key_bind ( /* m-w,m-down */ "meta-wmeta-meta2-B", "/window down");
|
||||
gui_key_bind ( /* m-w,m-left */ "meta-wmeta-meta2-D", "/window left");
|
||||
gui_key_bind ( /* m-w,m-right */ "meta-wmeta-meta2-C", "/window right");
|
||||
gui_key_bind ( /* m-0 */ "meta-0", "/buffer 10");
|
||||
gui_key_bind ( /* m-1 */ "meta-1", "/buffer 1");
|
||||
gui_key_bind ( /* m-2 */ "meta-2", "/buffer 2");
|
||||
gui_key_bind ( /* m-3 */ "meta-3", "/buffer 3");
|
||||
gui_key_bind ( /* m-4 */ "meta-4", "/buffer 4");
|
||||
gui_key_bind ( /* m-5 */ "meta-5", "/buffer 5");
|
||||
gui_key_bind ( /* m-6 */ "meta-6", "/buffer 6");
|
||||
gui_key_bind ( /* m-7 */ "meta-7", "/buffer 7");
|
||||
gui_key_bind ( /* m-8 */ "meta-8", "/buffer 8");
|
||||
gui_key_bind ( /* m-9 */ "meta-9", "/buffer 9");
|
||||
|
||||
/* bind meta-j + {01..99} to switch to buffers # > 10 */
|
||||
for (i = 1; i < 100; i++)
|
||||
@@ -151,7 +158,7 @@ gui_input_grab_end ()
|
||||
if (gui_current_window->buffer->has_input)
|
||||
{
|
||||
gui_insert_string_input (gui_current_window, expanded_key, -1);
|
||||
gui_current_window->buffer->input_buffer_pos += strlen (expanded_key);
|
||||
gui_current_window->buffer->input_buffer_pos += utf8_strlen (expanded_key);
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 1);
|
||||
}
|
||||
free (expanded_key);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GTK_CFLAGS)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-display.c: display functions for Gtk GUI */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-input: user input functions for Gtk GUI */
|
||||
|
||||
+122
-16
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-common.c: display functions, used by all GUI */
|
||||
@@ -88,29 +88,28 @@ gui_action_clipboard_paste (t_gui_window *window)
|
||||
void
|
||||
gui_action_return (t_gui_window *window)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
char *command;
|
||||
|
||||
if (window->buffer->has_input)
|
||||
{
|
||||
if (window->buffer->input_buffer_size > 0)
|
||||
{
|
||||
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
|
||||
history_add (window->buffer, window->buffer->input_buffer);
|
||||
command = strdup (window->buffer->input_buffer);
|
||||
if (!command)
|
||||
return;
|
||||
history_buffer_add (window->buffer, window->buffer->input_buffer);
|
||||
history_global_add (window->buffer->input_buffer);
|
||||
window->buffer->input_buffer[0] = '\0';
|
||||
window->buffer->input_buffer_size = 0;
|
||||
window->buffer->input_buffer_length = 0;
|
||||
window->buffer->input_buffer_pos = 0;
|
||||
window->buffer->input_buffer_1st_display = 0;
|
||||
window->buffer->completion.position = -1;
|
||||
window->buffer->ptr_history = NULL;
|
||||
ptr_buffer = window->buffer;
|
||||
user_command (SERVER(window->buffer),
|
||||
window->buffer,
|
||||
window->buffer->input_buffer);
|
||||
if (ptr_buffer == window->buffer)
|
||||
{
|
||||
ptr_buffer->input_buffer[0] = '\0';
|
||||
gui_draw_buffer_input (ptr_buffer, 0);
|
||||
}
|
||||
gui_draw_buffer_input (window->buffer, 0);
|
||||
user_command (window->buffer, SERVER(window->buffer), command);
|
||||
free (command);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,7 +126,6 @@ gui_action_tab (t_gui_window *window)
|
||||
if (window->buffer->has_input)
|
||||
{
|
||||
completion_search (&(window->buffer->completion),
|
||||
CHANNEL(window->buffer),
|
||||
window->buffer->input_buffer,
|
||||
window->buffer->input_buffer_size,
|
||||
utf8_real_pos (window->buffer->input_buffer,
|
||||
@@ -688,6 +686,26 @@ gui_action_up (t_gui_window *window)
|
||||
window->buffer->history;
|
||||
if (window->buffer->ptr_history)
|
||||
{
|
||||
/* bash/readline like use of history */
|
||||
if (window->buffer->ptr_history->prev_history == NULL)
|
||||
{
|
||||
if (window->buffer->input_buffer_size > 0)
|
||||
{
|
||||
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
|
||||
history_buffer_add (window->buffer, window->buffer->input_buffer);
|
||||
history_global_add (window->buffer->input_buffer);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (window->buffer->input_buffer_size > 0)
|
||||
{
|
||||
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
|
||||
if (window->buffer->ptr_history->prev_history->text)
|
||||
free(window->buffer->ptr_history->prev_history->text);
|
||||
window->buffer->ptr_history->prev_history->text = strdup (window->buffer->input_buffer);
|
||||
}
|
||||
}
|
||||
window->buffer->input_buffer_size =
|
||||
strlen (window->buffer->ptr_history->text);
|
||||
window->buffer->input_buffer_length =
|
||||
@@ -943,7 +961,7 @@ gui_action_jump_dcc (t_gui_window *window)
|
||||
else
|
||||
{
|
||||
buffer_before_dcc = window->buffer;
|
||||
gui_switch_to_dcc_buffer (window);
|
||||
gui_buffer_switch_dcc (window);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,7 +973,7 @@ void
|
||||
gui_action_jump_last_buffer (t_gui_window *window)
|
||||
{
|
||||
if (last_gui_buffer)
|
||||
gui_switch_to_buffer_by_number (window, last_gui_buffer->number);
|
||||
gui_buffer_switch_by_number (window, last_gui_buffer->number);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1030,6 +1048,94 @@ gui_action_switch_server (t_gui_window *window)
|
||||
gui_window_switch_server (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_action_scroll_previous_highlight: scroll to previous highlight
|
||||
*/
|
||||
|
||||
void
|
||||
gui_action_scroll_previous_highlight (t_gui_window *window)
|
||||
{
|
||||
t_gui_line *ptr_line;
|
||||
|
||||
if (!window->buffer->dcc)
|
||||
{
|
||||
if (window->buffer->lines)
|
||||
{
|
||||
ptr_line = (window->start_line) ?
|
||||
window->start_line->prev_line : window->buffer->last_line->prev_line;
|
||||
while (ptr_line)
|
||||
{
|
||||
if (ptr_line->line_with_highlight)
|
||||
{
|
||||
window->start_line = ptr_line;
|
||||
window->start_line_pos = 0;
|
||||
window->first_line_displayed =
|
||||
(window->start_line == window->buffer->lines);
|
||||
gui_draw_buffer_chat (window->buffer, 1);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
return;
|
||||
}
|
||||
ptr_line = ptr_line->prev_line;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_action_scroll_next_highlight: scroll to next highlight
|
||||
*/
|
||||
|
||||
void
|
||||
gui_action_scroll_next_highlight (t_gui_window *window)
|
||||
{
|
||||
t_gui_line *ptr_line;
|
||||
|
||||
if (!window->buffer->dcc)
|
||||
{
|
||||
if (window->buffer->lines)
|
||||
{
|
||||
ptr_line = (window->start_line) ?
|
||||
window->start_line->next_line : window->buffer->lines->next_line;
|
||||
while (ptr_line)
|
||||
{
|
||||
if (ptr_line->line_with_highlight)
|
||||
{
|
||||
window->start_line = ptr_line;
|
||||
window->start_line_pos = 0;
|
||||
window->first_line_displayed =
|
||||
(window->start_line == window->buffer->lines);
|
||||
gui_draw_buffer_chat (window->buffer, 1);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
return;
|
||||
}
|
||||
ptr_line = ptr_line->next_line;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_action_scroll_unread: scroll to first unread line of buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_action_scroll_unread (t_gui_window *window)
|
||||
{
|
||||
if (cfg_look_read_marker &&
|
||||
cfg_look_read_marker[0] &&
|
||||
!window->buffer->dcc &&
|
||||
window->buffer->last_read_line &&
|
||||
window->buffer->last_read_line != window->buffer->last_line)
|
||||
{
|
||||
window->start_line = window->buffer->last_read_line->next_line;
|
||||
window->start_line_pos = 0;
|
||||
window->first_line_displayed =
|
||||
(window->start_line == window->buffer->lines);
|
||||
gui_draw_buffer_chat (window->buffer, 1);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_action_hotlist_clear: clear hotlist
|
||||
*/
|
||||
|
||||
+375
-165
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-common.c: display functions, used by all GUI */
|
||||
@@ -54,6 +54,8 @@ t_gui_window *gui_windows = NULL; /* pointer to first window */
|
||||
t_gui_window *last_gui_window = NULL; /* pointer to last window */
|
||||
t_gui_window *gui_current_window = NULL; /* pointer to current window */
|
||||
|
||||
t_gui_window_tree *gui_windows_tree = NULL; /* pointer to windows tree */
|
||||
|
||||
t_gui_buffer *gui_buffers = NULL; /* pointer to first buffer */
|
||||
t_gui_buffer *last_gui_buffer = NULL; /* pointer to last buffer */
|
||||
t_gui_buffer *buffer_before_dcc = NULL; /* buffer before dcc switch */
|
||||
@@ -61,25 +63,148 @@ t_gui_infobar *gui_infobar; /* pointer to infobar content */
|
||||
|
||||
char *gui_input_clipboard = NULL; /* clipboard content */
|
||||
|
||||
|
||||
/*
|
||||
* gui_window_tree_init: create first entry in windows tree
|
||||
*/
|
||||
|
||||
int
|
||||
gui_window_tree_init (t_gui_window *window)
|
||||
{
|
||||
gui_windows_tree = (t_gui_window_tree *)malloc (sizeof (t_gui_window_tree));
|
||||
if (!gui_windows_tree)
|
||||
return 0;
|
||||
gui_windows_tree->parent_node = NULL;
|
||||
gui_windows_tree->split_horiz = 0;
|
||||
gui_windows_tree->split_pct = 0;
|
||||
gui_windows_tree->child1 = NULL;
|
||||
gui_windows_tree->child2 = NULL;
|
||||
gui_windows_tree->window = window;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_tree_node_to_leaf: convert a node to a leaf (free any leafs)
|
||||
* Called when 2 windows are merging into one
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_tree_node_to_leaf (t_gui_window_tree *node, t_gui_window *window)
|
||||
{
|
||||
node->split_horiz = 0;
|
||||
node->split_pct = 0;
|
||||
if (node->child1)
|
||||
{
|
||||
free (node->child1);
|
||||
node->child1 = NULL;
|
||||
}
|
||||
if (node->child2)
|
||||
{
|
||||
free (node->child2);
|
||||
node->child2 = NULL;
|
||||
}
|
||||
node->window = window;
|
||||
window->ptr_tree = node;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_tree_free: delete entire windows tree
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_tree_free (t_gui_window_tree **tree)
|
||||
{
|
||||
if (*tree)
|
||||
{
|
||||
if ((*tree)->child1)
|
||||
gui_window_tree_free (&((*tree)->child1));
|
||||
if ((*tree)->child2)
|
||||
gui_window_tree_free (&((*tree)->child2));
|
||||
free (*tree);
|
||||
*tree = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_new: create a new window
|
||||
*/
|
||||
|
||||
t_gui_window *
|
||||
gui_window_new (int x, int y, int width, int height)
|
||||
gui_window_new (t_gui_window *parent, int x, int y, int width, int height,
|
||||
int width_pct, int height_pct)
|
||||
{
|
||||
t_gui_window *new_window;
|
||||
t_gui_window_tree *ptr_tree, *child1, *child2, *ptr_leaf;
|
||||
|
||||
#ifdef DEBUG
|
||||
wee_log_printf ("Creating new window (x:%d, y:%d, width:%d, height:%d)\n",
|
||||
x, y, width, height);
|
||||
weechat_log_printf ("Creating new window (x:%d, y:%d, width:%d, height:%d)\n",
|
||||
x, y, width, height);
|
||||
#endif
|
||||
|
||||
if (parent)
|
||||
{
|
||||
child1 = (t_gui_window_tree *)malloc (sizeof (t_gui_window_tree));
|
||||
if (!child1)
|
||||
return NULL;
|
||||
child2 = (t_gui_window_tree *)malloc (sizeof (t_gui_window_tree));
|
||||
if (!child2)
|
||||
{
|
||||
free (child1);
|
||||
return NULL;
|
||||
}
|
||||
ptr_tree = parent->ptr_tree;
|
||||
|
||||
if (width_pct == 100)
|
||||
{
|
||||
ptr_tree->split_horiz = 1;
|
||||
ptr_tree->split_pct = height_pct;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_tree->split_horiz = 0;
|
||||
ptr_tree->split_pct = width_pct;
|
||||
}
|
||||
|
||||
/* parent window leaf becomes node and we add 2 leafs below
|
||||
(#1 is parent win, #2 is new win) */
|
||||
|
||||
parent->ptr_tree = child1;
|
||||
child1->parent_node = ptr_tree;
|
||||
child1->child1 = NULL;
|
||||
child1->child2 = NULL;
|
||||
child1->window = ptr_tree->window;
|
||||
|
||||
child2->parent_node = ptr_tree;
|
||||
child2->child1 = NULL;
|
||||
child2->child2 = NULL;
|
||||
child2->window = NULL; /* will be assigned by new window below */
|
||||
|
||||
ptr_tree->child1 = child1;
|
||||
ptr_tree->child2 = child2;
|
||||
ptr_tree->window = NULL; /* leaf becomes node */
|
||||
|
||||
ptr_leaf = child2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!gui_window_tree_init (NULL))
|
||||
return NULL;
|
||||
ptr_leaf = gui_windows_tree;
|
||||
}
|
||||
|
||||
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
|
||||
{
|
||||
new_window->win_x = x;
|
||||
new_window->win_y = y;
|
||||
new_window->win_width = width;
|
||||
new_window->win_height = height;
|
||||
new_window->win_width_pct = width_pct;
|
||||
new_window->win_height_pct = height_pct;
|
||||
|
||||
new_window->new_x = -1;
|
||||
new_window->new_y = -1;
|
||||
new_window->new_width = -1;
|
||||
new_window->new_height = -1;
|
||||
|
||||
new_window->win_chat_x = 0;
|
||||
new_window->win_chat_y = 0;
|
||||
@@ -119,6 +244,10 @@ gui_window_new (int x, int y, int width, int height)
|
||||
new_window->first_line_displayed = 0;
|
||||
new_window->start_line = NULL;
|
||||
new_window->start_line_pos = 0;
|
||||
new_window->scroll = 0;
|
||||
|
||||
new_window->ptr_tree = ptr_leaf;
|
||||
ptr_leaf->window = new_window;
|
||||
|
||||
/* add window to windows queue */
|
||||
new_window->prev_window = last_gui_window;
|
||||
@@ -135,6 +264,86 @@ gui_window_new (int x, int y, int width, int height)
|
||||
return new_window;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_buffer_search: search a buffer by server and channel name
|
||||
*/
|
||||
|
||||
t_gui_buffer *
|
||||
gui_buffer_search (char *server, char *channel)
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
t_irc_channel *ptr_channel;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
ptr_server = NULL;
|
||||
ptr_channel = NULL;
|
||||
ptr_buffer = NULL;
|
||||
|
||||
/* nothing given => print on current buffer */
|
||||
if ((!server || !server[0]) && (!channel || !channel[0]))
|
||||
ptr_buffer = gui_current_window->buffer;
|
||||
else
|
||||
{
|
||||
if (server && server[0])
|
||||
{
|
||||
ptr_server = server_search (server);
|
||||
if (!ptr_server)
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_server = SERVER(gui_current_window->buffer);
|
||||
if (!ptr_server)
|
||||
ptr_server = SERVER(gui_buffers);
|
||||
}
|
||||
|
||||
if (channel && channel[0])
|
||||
{
|
||||
if (ptr_server)
|
||||
{
|
||||
ptr_channel = channel_search (ptr_server, channel);
|
||||
if (ptr_channel)
|
||||
ptr_buffer = ptr_channel->buffer;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ptr_server)
|
||||
ptr_buffer = ptr_server->buffer;
|
||||
else
|
||||
ptr_buffer = gui_current_window->buffer;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ptr_buffer)
|
||||
return NULL;
|
||||
|
||||
return (ptr_buffer->dcc) ? gui_buffers : ptr_buffer;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_buffer_find_window: find a window displaying buffer
|
||||
*/
|
||||
|
||||
t_gui_window *
|
||||
gui_buffer_find_window (t_gui_buffer *buffer)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
if (gui_current_window->buffer == buffer)
|
||||
return gui_current_window;
|
||||
|
||||
for (ptr_win = gui_windows; ptr_win;
|
||||
ptr_win = ptr_win->next_window)
|
||||
{
|
||||
if (ptr_win->buffer == buffer)
|
||||
return ptr_win;
|
||||
}
|
||||
|
||||
/* no window found */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_buffer_servers_search: search servers buffer
|
||||
* (when same buffer is used for all servers)
|
||||
@@ -167,7 +376,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
|
||||
t_gui_buffer *new_buffer, *ptr_buffer;
|
||||
|
||||
#ifdef DEBUG
|
||||
wee_log_printf ("Creating new buffer\n");
|
||||
weechat_log_printf ("Creating new buffer\n");
|
||||
#endif
|
||||
|
||||
/* use first buffer if no server was assigned to this buffer */
|
||||
@@ -234,6 +443,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
|
||||
/* init lines */
|
||||
new_buffer->lines = NULL;
|
||||
new_buffer->last_line = NULL;
|
||||
new_buffer->last_read_line = NULL;
|
||||
new_buffer->num_lines = 0;
|
||||
new_buffer->line_complete = 1;
|
||||
|
||||
@@ -264,7 +474,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
|
||||
new_buffer->input_buffer_1st_display = 0;
|
||||
|
||||
/* init completion */
|
||||
completion_init (&(new_buffer->completion));
|
||||
completion_init (&(new_buffer->completion), server, channel);
|
||||
|
||||
/* init history */
|
||||
new_buffer->history = NULL;
|
||||
@@ -425,7 +635,7 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
|
||||
{
|
||||
if ((buffer == ptr_win->buffer) &&
|
||||
((buffer->next_buffer) || (buffer->prev_buffer)))
|
||||
gui_switch_to_previous_buffer (ptr_win);
|
||||
gui_buffer_switch_previous (ptr_win);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,11 +688,11 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_new_line: create new line for a buffer
|
||||
* gui_line_new: create new line for a buffer
|
||||
*/
|
||||
|
||||
t_gui_line *
|
||||
gui_new_line (t_gui_buffer *buffer)
|
||||
gui_line_new (t_gui_buffer *buffer)
|
||||
{
|
||||
t_gui_line *new_line, *ptr_line;
|
||||
|
||||
@@ -506,7 +716,7 @@ gui_new_line (t_gui_buffer *buffer)
|
||||
}
|
||||
else
|
||||
{
|
||||
wee_log_printf (_("Not enough memory for new line\n"));
|
||||
weechat_log_printf (_("Not enough memory for new line\n"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -521,7 +731,6 @@ gui_new_line (t_gui_buffer *buffer)
|
||||
buffer->lines = ptr_line;
|
||||
ptr_line->prev_line = NULL;
|
||||
buffer->num_lines--;
|
||||
//if (buffer->first_line_displayed)
|
||||
gui_draw_buffer_chat (buffer, 1);
|
||||
}
|
||||
|
||||
@@ -587,7 +796,7 @@ gui_add_to_line (t_gui_buffer *buffer, int type, char *message)
|
||||
if (buffer->line_complete)
|
||||
{
|
||||
buffer->line_complete = 0;
|
||||
if (!gui_new_line (buffer))
|
||||
if (!gui_line_new (buffer))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -635,13 +844,13 @@ gui_add_to_line (t_gui_buffer *buffer, int type, char *message)
|
||||
buffer->notify_level)
|
||||
{
|
||||
if (buffer->last_line->line_with_highlight)
|
||||
hotlist_add (HOTLIST_HIGHLIGHT, buffer);
|
||||
hotlist_add (HOTLIST_HIGHLIGHT, SERVER(buffer), buffer);
|
||||
else if (BUFFER_IS_PRIVATE(buffer) && (buffer->last_line->line_with_message))
|
||||
hotlist_add (HOTLIST_PRIVATE, buffer);
|
||||
hotlist_add (HOTLIST_PRIVATE, SERVER(buffer), buffer);
|
||||
else if (buffer->last_line->line_with_message)
|
||||
hotlist_add (HOTLIST_MSG, buffer);
|
||||
hotlist_add (HOTLIST_MSG, SERVER(buffer), buffer);
|
||||
else
|
||||
hotlist_add (HOTLIST_LOW, buffer);
|
||||
hotlist_add (HOTLIST_LOW, SERVER(buffer), buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
@@ -671,7 +880,7 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type, char *mes
|
||||
time_t time_seconds;
|
||||
struct tm *local_time;
|
||||
int time_first_digit, time_last_digit;
|
||||
char *pos, *buf2;
|
||||
char *buf2, *pos;
|
||||
int i;
|
||||
va_list argptr;
|
||||
static time_t seconds;
|
||||
@@ -693,8 +902,8 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type, char *mes
|
||||
|
||||
if (buffer == NULL)
|
||||
{
|
||||
wee_log_printf ("WARNING: gui_printf_internal without buffer! This is a bug, "
|
||||
"please send to developers - thanks\n");
|
||||
weechat_log_printf ("WARNING: gui_printf_internal without buffer! This is a bug, "
|
||||
"please send to developers - thanks\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -712,12 +921,8 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type, char *mes
|
||||
if (!buf[0])
|
||||
return;
|
||||
|
||||
if (!local_utf8 || !utf8_is_valid (buf))
|
||||
buf2 = weechat_convert_encoding ((local_utf8) ?
|
||||
cfg_look_charset_decode_iso : cfg_look_charset_decode_utf,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
buf);
|
||||
if (gui_init_ok)
|
||||
buf2 = channel_iconv_decode (SERVER(buffer), CHANNEL(buffer), buf);
|
||||
else
|
||||
buf2 = strdup (buf);
|
||||
|
||||
@@ -726,75 +931,82 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type, char *mes
|
||||
seconds = time (NULL);
|
||||
date_tmp = localtime (&seconds);
|
||||
|
||||
pos = buf2 - 1;
|
||||
pos = buf2;
|
||||
while (pos)
|
||||
{
|
||||
if (display_time
|
||||
&& cfg_look_buffer_timestamp && cfg_look_buffer_timestamp[0]
|
||||
&& ((!buffer->last_line) || (buffer->line_complete)))
|
||||
if ((!buffer->last_line) || (buffer->line_complete))
|
||||
{
|
||||
time_seconds = time (NULL);
|
||||
local_time = localtime (&time_seconds);
|
||||
strftime (text_time, sizeof (text_time), cfg_look_buffer_timestamp, local_time);
|
||||
|
||||
time_first_digit = -1;
|
||||
time_last_digit = -1;
|
||||
i = 0;
|
||||
while (text_time[i])
|
||||
if (display_time && cfg_look_buffer_timestamp &&
|
||||
cfg_look_buffer_timestamp[0])
|
||||
{
|
||||
if (isdigit (text_time[i]))
|
||||
time_seconds = time (NULL);
|
||||
local_time = localtime (&time_seconds);
|
||||
strftime (text_time, sizeof (text_time), cfg_look_buffer_timestamp, local_time);
|
||||
|
||||
time_first_digit = -1;
|
||||
time_last_digit = -1;
|
||||
i = 0;
|
||||
while (text_time[i])
|
||||
{
|
||||
if (time_first_digit == -1)
|
||||
time_first_digit = i;
|
||||
time_last_digit = i;
|
||||
if (isdigit (text_time[i]))
|
||||
{
|
||||
if (time_first_digit == -1)
|
||||
time_first_digit = i;
|
||||
time_last_digit = i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
text_time_char[1] = '\0';
|
||||
i = 0;
|
||||
while (text_time[i])
|
||||
{
|
||||
text_time_char[0] = text_time[i];
|
||||
if (time_first_digit < 0)
|
||||
|
||||
text_time_char[1] = '\0';
|
||||
i = 0;
|
||||
while (text_time[i])
|
||||
{
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_TIME));
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((i < time_first_digit) || (i > time_last_digit))
|
||||
text_time_char[0] = text_time[i];
|
||||
if (time_first_digit < 0)
|
||||
{
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK));
|
||||
GUI_COLOR(COLOR_WIN_CHAT_TIME));
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isdigit (text_time[i]))
|
||||
if ((i < time_first_digit) || (i > time_last_digit))
|
||||
{
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_TIME));
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK));
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_TIME_SEP));
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
|
||||
if (isdigit (text_time[i]))
|
||||
{
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_TIME));
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_TIME_SEP));
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME, text_time_char);
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
i++;
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME, GUI_COLOR(COLOR_WIN_CHAT));
|
||||
}
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME, GUI_COLOR(COLOR_WIN_CHAT));
|
||||
gui_add_to_line (buffer, MSG_TYPE_TIME, " ");
|
||||
}
|
||||
gui_add_to_line (buffer, type, pos + 1);
|
||||
pos = strchr (pos + 1, '\n');
|
||||
if (pos && !pos[1])
|
||||
pos = NULL;
|
||||
gui_add_to_line (buffer, type, pos);
|
||||
pos = strchr (pos, '\n');
|
||||
if (pos)
|
||||
{
|
||||
if (!pos[1])
|
||||
pos = NULL;
|
||||
else
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -822,16 +1034,7 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
|
||||
buf2 = (char *)gui_color_decode ((unsigned char *)buffer, 0);
|
||||
|
||||
if (buf2)
|
||||
{
|
||||
if (!local_utf8 || !utf8_is_valid (buf2))
|
||||
buf3 = weechat_convert_encoding ((local_utf8) ?
|
||||
cfg_look_charset_decode_iso : cfg_look_charset_decode_utf,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
buf2);
|
||||
else
|
||||
buf3 = strdup (buf2);
|
||||
}
|
||||
buf3 = channel_iconv_decode (NULL, NULL, buf2);
|
||||
else
|
||||
buf3 = NULL;
|
||||
|
||||
@@ -851,7 +1054,7 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
|
||||
gui_draw_buffer_infobar (gui_current_window->buffer, 1);
|
||||
}
|
||||
else
|
||||
wee_log_printf (_("Not enough memory for infobar message\n"));
|
||||
weechat_log_printf (_("Not enough memory for infobar message\n"));
|
||||
}
|
||||
|
||||
if (buf2)
|
||||
@@ -1167,11 +1370,11 @@ gui_window_switch_server (t_gui_window *window)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_previous_buffer: switch to previous buffer
|
||||
* gui_buffer_switch_previous: switch to previous buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_previous_buffer (t_gui_window *window)
|
||||
gui_buffer_switch_previous (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
@@ -1189,11 +1392,11 @@ gui_switch_to_previous_buffer (t_gui_window *window)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_next_buffer: switch to next buffer
|
||||
* gui_buffer_switch_next: switch to next buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_next_buffer (t_gui_window *window)
|
||||
gui_buffer_switch_next (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
@@ -1211,11 +1414,11 @@ gui_switch_to_next_buffer (t_gui_window *window)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_previous_window: switch to previous window
|
||||
* gui_window_switch_previous: switch to previous window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_previous_window (t_gui_window *window)
|
||||
gui_window_switch_previous (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
@@ -1230,11 +1433,11 @@ gui_switch_to_previous_window (t_gui_window *window)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_next_window: switch to next window
|
||||
* gui_window_switch_next: switch to next window
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_next_window (t_gui_window *window)
|
||||
gui_window_switch_next (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
@@ -1249,11 +1452,11 @@ gui_switch_to_next_window (t_gui_window *window)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_window_by_buffer: switch to next window displaying a buffer
|
||||
* gui_window_switch_by_buffer: switch to next window displaying a buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_window_by_buffer (t_gui_window *window, int buffer_number)
|
||||
gui_window_switch_by_buffer (t_gui_window *window, int buffer_number)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
|
||||
@@ -1275,11 +1478,11 @@ gui_switch_to_window_by_buffer (t_gui_window *window, int buffer_number)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_dcc_buffer: switch to dcc buffer (create it if it does not exist)
|
||||
* gui_buffer_switch_dcc: switch to dcc buffer (create it if it does not exist)
|
||||
*/
|
||||
|
||||
void
|
||||
gui_switch_to_dcc_buffer (t_gui_window *window)
|
||||
gui_buffer_switch_dcc (t_gui_window *window)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
@@ -1299,11 +1502,11 @@ gui_switch_to_dcc_buffer (t_gui_window *window)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_buffer_by_number: switch to another buffer with number
|
||||
* gui_buffer_switch_by_number: switch to another buffer with number
|
||||
*/
|
||||
|
||||
t_gui_buffer *
|
||||
gui_switch_to_buffer_by_number (t_gui_window *window, int number)
|
||||
gui_buffer_switch_by_number (t_gui_window *window, int number)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
@@ -1331,15 +1534,19 @@ gui_switch_to_buffer_by_number (t_gui_window *window, int number)
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_switch_to_buffer_by_number: switch to another buffer with number
|
||||
* gui_buffer_move_to_number: move a buffer to another number
|
||||
*/
|
||||
|
||||
void
|
||||
gui_move_buffer_to_number (t_gui_window *window, int number)
|
||||
gui_buffer_move_to_number (t_gui_window *window, int number)
|
||||
{
|
||||
t_gui_buffer *ptr_buffer;
|
||||
int i;
|
||||
|
||||
/* if only one buffer then return */
|
||||
if (gui_buffers == last_gui_buffer)
|
||||
return;
|
||||
|
||||
/* buffer number is already ok ? */
|
||||
if (number == window->buffer->number)
|
||||
return;
|
||||
@@ -1422,43 +1629,45 @@ gui_move_buffer_to_number (t_gui_window *window, int number)
|
||||
void
|
||||
gui_window_print_log (t_gui_window *window)
|
||||
{
|
||||
wee_log_printf ("[window (addr:0x%X)]\n", window);
|
||||
wee_log_printf (" win_x . . . . . . . : %d\n", window->win_x);
|
||||
wee_log_printf (" win_y . . . . . . . : %d\n", window->win_y);
|
||||
wee_log_printf (" win_width . . . . . : %d\n", window->win_width);
|
||||
wee_log_printf (" win_height. . . . . : %d\n", window->win_height);
|
||||
wee_log_printf (" win_chat_x. . . . . : %d\n", window->win_chat_x);
|
||||
wee_log_printf (" win_chat_y. . . . . : %d\n", window->win_chat_y);
|
||||
wee_log_printf (" win_chat_width. . . : %d\n", window->win_chat_width);
|
||||
wee_log_printf (" win_chat_height . . : %d\n", window->win_chat_height);
|
||||
wee_log_printf (" win_chat_cursor_x . : %d\n", window->win_chat_cursor_x);
|
||||
wee_log_printf (" win_chat_cursor_y . : %d\n", window->win_chat_cursor_y);
|
||||
wee_log_printf (" win_nick_x. . . . . : %d\n", window->win_nick_x);
|
||||
wee_log_printf (" win_nick_y. . . . . : %d\n", window->win_nick_y);
|
||||
wee_log_printf (" win_nick_width. . . : %d\n", window->win_nick_width);
|
||||
wee_log_printf (" win_nick_height . . : %d\n", window->win_nick_height);
|
||||
wee_log_printf (" win_nick_start. . . : %d\n", window->win_nick_start);
|
||||
wee_log_printf (" win_title . . . . . : 0x%X\n", window->win_title);
|
||||
wee_log_printf (" win_chat. . . . . . : 0x%X\n", window->win_chat);
|
||||
wee_log_printf (" win_nick. . . . . . : 0x%X\n", window->win_nick);
|
||||
wee_log_printf (" win_status. . . . . : 0x%X\n", window->win_status);
|
||||
wee_log_printf (" win_infobar . . . . : 0x%X\n", window->win_infobar);
|
||||
wee_log_printf (" win_input . . . . . : 0x%X\n", window->win_input);
|
||||
wee_log_printf (" win_separator . . . : 0x%X\n", window->win_separator);
|
||||
wee_log_printf (" textview_chat . . . : 0x%X\n", window->textview_chat);
|
||||
wee_log_printf (" textbuffer_chat . . : 0x%X\n", window->textbuffer_chat);
|
||||
wee_log_printf (" texttag_chat. . . . : 0x%X\n", window->texttag_chat);
|
||||
wee_log_printf (" textview_nicklist . : 0x%X\n", window->textview_nicklist);
|
||||
wee_log_printf (" textbuffer_nicklist : 0x%X\n", window->textbuffer_nicklist);
|
||||
wee_log_printf (" dcc_first . . . . . : 0x%X\n", window->dcc_first);
|
||||
wee_log_printf (" dcc_selected. . . . : 0x%X\n", window->dcc_selected);
|
||||
wee_log_printf (" dcc_last_displayed. : 0x%X\n", window->dcc_last_displayed);
|
||||
wee_log_printf (" buffer. . . . . . . : 0x%X\n", window->buffer);
|
||||
wee_log_printf (" first_line_displayed: %d\n", window->first_line_displayed);
|
||||
wee_log_printf (" start_line. . . . . : 0x%X\n", window->start_line);
|
||||
wee_log_printf (" start_line_pos. . . : %d\n", window->start_line_pos);
|
||||
wee_log_printf (" prev_window . . . . : 0x%X\n", window->prev_window);
|
||||
wee_log_printf (" next_window . . . . : 0x%X\n", window->next_window);
|
||||
weechat_log_printf ("[window (addr:0x%X)]\n", window);
|
||||
weechat_log_printf (" win_x . . . . . . . : %d\n", window->win_x);
|
||||
weechat_log_printf (" win_y . . . . . . . : %d\n", window->win_y);
|
||||
weechat_log_printf (" win_width . . . . . : %d\n", window->win_width);
|
||||
weechat_log_printf (" win_height. . . . . : %d\n", window->win_height);
|
||||
weechat_log_printf (" win_width_pct . . . : %d\n", window->win_width_pct);
|
||||
weechat_log_printf (" win_height_pct. . . : %d\n", window->win_height_pct);
|
||||
weechat_log_printf (" win_chat_x. . . . . : %d\n", window->win_chat_x);
|
||||
weechat_log_printf (" win_chat_y. . . . . : %d\n", window->win_chat_y);
|
||||
weechat_log_printf (" win_chat_width. . . : %d\n", window->win_chat_width);
|
||||
weechat_log_printf (" win_chat_height . . : %d\n", window->win_chat_height);
|
||||
weechat_log_printf (" win_chat_cursor_x . : %d\n", window->win_chat_cursor_x);
|
||||
weechat_log_printf (" win_chat_cursor_y . : %d\n", window->win_chat_cursor_y);
|
||||
weechat_log_printf (" win_nick_x. . . . . : %d\n", window->win_nick_x);
|
||||
weechat_log_printf (" win_nick_y. . . . . : %d\n", window->win_nick_y);
|
||||
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 . . . . . : 0x%X\n", window->win_title);
|
||||
weechat_log_printf (" win_chat. . . . . . : 0x%X\n", window->win_chat);
|
||||
weechat_log_printf (" win_nick. . . . . . : 0x%X\n", window->win_nick);
|
||||
weechat_log_printf (" win_status. . . . . : 0x%X\n", window->win_status);
|
||||
weechat_log_printf (" win_infobar . . . . : 0x%X\n", window->win_infobar);
|
||||
weechat_log_printf (" win_input . . . . . : 0x%X\n", window->win_input);
|
||||
weechat_log_printf (" win_separator . . . : 0x%X\n", window->win_separator);
|
||||
weechat_log_printf (" textview_chat . . . : 0x%X\n", window->textview_chat);
|
||||
weechat_log_printf (" textbuffer_chat . . : 0x%X\n", window->textbuffer_chat);
|
||||
weechat_log_printf (" texttag_chat. . . . : 0x%X\n", window->texttag_chat);
|
||||
weechat_log_printf (" textview_nicklist . : 0x%X\n", window->textview_nicklist);
|
||||
weechat_log_printf (" textbuffer_nicklist : 0x%X\n", window->textbuffer_nicklist);
|
||||
weechat_log_printf (" dcc_first . . . . . : 0x%X\n", window->dcc_first);
|
||||
weechat_log_printf (" dcc_selected. . . . : 0x%X\n", window->dcc_selected);
|
||||
weechat_log_printf (" dcc_last_displayed. : 0x%X\n", window->dcc_last_displayed);
|
||||
weechat_log_printf (" buffer. . . . . . . : 0x%X\n", window->buffer);
|
||||
weechat_log_printf (" first_line_displayed: %d\n", window->first_line_displayed);
|
||||
weechat_log_printf (" start_line. . . . . : 0x%X\n", window->start_line);
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@@ -1472,34 +1681,35 @@ gui_buffer_print_log (t_gui_buffer *buffer)
|
||||
t_gui_line *ptr_line;
|
||||
int num;
|
||||
|
||||
wee_log_printf ("[buffer (addr:0x%X)]\n", buffer);
|
||||
wee_log_printf (" num_displayed. . . . : %d\n", buffer->num_displayed);
|
||||
wee_log_printf (" number . . . . . . . : %d\n", buffer->number);
|
||||
wee_log_printf (" server . . . . . . . : 0x%X\n", buffer->server);
|
||||
wee_log_printf (" all_servers. . . . . : %d\n", buffer->all_servers);
|
||||
wee_log_printf (" channel. . . . . . . : 0x%X\n", buffer->channel);
|
||||
wee_log_printf (" dcc. . . . . . . . . : %d\n", buffer->dcc);
|
||||
wee_log_printf (" lines. . . . . . . . : 0x%X\n", buffer->lines);
|
||||
wee_log_printf (" last_line. . . . . . : 0x%X\n", buffer->last_line);
|
||||
wee_log_printf (" num_lines. . . . . . : %d\n", buffer->num_lines);
|
||||
wee_log_printf (" line_complete. . . . : %d\n", buffer->line_complete);
|
||||
wee_log_printf (" notify_level . . . . : %d\n", buffer->notify_level);
|
||||
wee_log_printf (" log_filename . . . . : '%s'\n", buffer->log_filename);
|
||||
wee_log_printf (" log_file . . . . . . : 0x%X\n", buffer->log_file);
|
||||
wee_log_printf (" has_input. . . . . . : %d\n", buffer->has_input);
|
||||
wee_log_printf (" input_buffer . . . . : '%s'\n", buffer->input_buffer);
|
||||
wee_log_printf (" input_buffer_alloc . : %d\n", buffer->input_buffer_alloc);
|
||||
wee_log_printf (" input_buffer_size. . : %d\n", buffer->input_buffer_size);
|
||||
wee_log_printf (" input_buffer_length. : %d\n", buffer->input_buffer_length);
|
||||
wee_log_printf (" input_buffer_pos . . : %d\n", buffer->input_buffer_pos);
|
||||
wee_log_printf (" input_buffer_1st_disp: %d\n", buffer->input_buffer_1st_display);
|
||||
wee_log_printf (" history. . . . . . . : 0x%X\n", buffer->history);
|
||||
wee_log_printf (" last_history . . . . : 0x%X\n", buffer->last_history);
|
||||
wee_log_printf (" ptr_history. . . . . : 0x%X\n", buffer->ptr_history);
|
||||
wee_log_printf (" prev_buffer. . . . . : 0x%X\n", buffer->prev_buffer);
|
||||
wee_log_printf (" next_buffer. . . . . : 0x%X\n", buffer->next_buffer);
|
||||
wee_log_printf ("\n");
|
||||
wee_log_printf (" => last 100 lines:\n");
|
||||
weechat_log_printf ("[buffer (addr:0x%X)]\n", buffer);
|
||||
weechat_log_printf (" num_displayed. . . . : %d\n", buffer->num_displayed);
|
||||
weechat_log_printf (" number . . . . . . . : %d\n", buffer->number);
|
||||
weechat_log_printf (" server . . . . . . . : 0x%X\n", buffer->server);
|
||||
weechat_log_printf (" all_servers. . . . . : %d\n", buffer->all_servers);
|
||||
weechat_log_printf (" channel. . . . . . . : 0x%X\n", buffer->channel);
|
||||
weechat_log_printf (" dcc. . . . . . . . . : %d\n", buffer->dcc);
|
||||
weechat_log_printf (" lines. . . . . . . . : 0x%X\n", buffer->lines);
|
||||
weechat_log_printf (" last_line. . . . . . : 0x%X\n", buffer->last_line);
|
||||
weechat_log_printf (" last_read_line . . . : 0x%X\n", buffer->last_read_line);
|
||||
weechat_log_printf (" num_lines. . . . . . : %d\n", buffer->num_lines);
|
||||
weechat_log_printf (" line_complete. . . . : %d\n", buffer->line_complete);
|
||||
weechat_log_printf (" notify_level . . . . : %d\n", buffer->notify_level);
|
||||
weechat_log_printf (" log_filename . . . . : '%s'\n", buffer->log_filename);
|
||||
weechat_log_printf (" log_file . . . . . . : 0x%X\n", buffer->log_file);
|
||||
weechat_log_printf (" has_input. . . . . . : %d\n", buffer->has_input);
|
||||
weechat_log_printf (" input_buffer . . . . : '%s'\n", buffer->input_buffer);
|
||||
weechat_log_printf (" input_buffer_alloc . : %d\n", buffer->input_buffer_alloc);
|
||||
weechat_log_printf (" input_buffer_size. . : %d\n", buffer->input_buffer_size);
|
||||
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 (" 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);
|
||||
weechat_log_printf (" prev_buffer. . . . . : 0x%X\n", buffer->prev_buffer);
|
||||
weechat_log_printf (" next_buffer. . . . . : 0x%X\n", buffer->next_buffer);
|
||||
weechat_log_printf ("\n");
|
||||
weechat_log_printf (" => last 100 lines:\n");
|
||||
|
||||
num = 0;
|
||||
ptr_line = buffer->last_line;
|
||||
@@ -1516,9 +1726,9 @@ gui_buffer_print_log (t_gui_buffer *buffer)
|
||||
while (ptr_line)
|
||||
{
|
||||
num--;
|
||||
wee_log_printf (" line N-%05d: %s\n",
|
||||
num,
|
||||
(ptr_line->data) ? ptr_line->data : "(empty)");
|
||||
weechat_log_printf (" line N-%05d: %s\n",
|
||||
num,
|
||||
(ptr_line->data) ? ptr_line->data : "(empty)");
|
||||
|
||||
ptr_line = ptr_line->next_line;
|
||||
}
|
||||
|
||||
+53
-47
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-keyboard: keyboard functions (GUI independant) */
|
||||
@@ -41,79 +41,85 @@ int gui_key_grab = 0;
|
||||
int gui_key_grab_count = 0;
|
||||
|
||||
t_gui_key_function gui_key_functions[] =
|
||||
{ { "return", gui_action_return,
|
||||
{ { "return", gui_action_return,
|
||||
N_("terminate line") },
|
||||
{ "tab", gui_action_tab,
|
||||
{ "tab", gui_action_tab,
|
||||
N_("complete word") },
|
||||
{ "backspace", gui_action_backspace,
|
||||
{ "backspace", gui_action_backspace,
|
||||
N_("delete previous char") },
|
||||
{ "delete", gui_action_delete,
|
||||
{ "delete", gui_action_delete,
|
||||
N_("delete next char") },
|
||||
{ "delete_end_line", gui_action_delete_end_of_line,
|
||||
{ "delete_end_line", gui_action_delete_end_of_line,
|
||||
N_("delete until end of line") },
|
||||
{ "delete_beginning_line", gui_action_delete_begin_of_line,
|
||||
{ "delete_beginning_line", gui_action_delete_begin_of_line,
|
||||
N_("delete until beginning of line") },
|
||||
{ "delete_line", gui_action_delete_line,
|
||||
{ "delete_line", gui_action_delete_line,
|
||||
N_("delete entire line") },
|
||||
{ "delete_previous_word", gui_action_delete_previous_word,
|
||||
{ "delete_previous_word", gui_action_delete_previous_word,
|
||||
N_("delete previous word") },
|
||||
{ "delete_next_word", gui_action_delete_next_word,
|
||||
{ "delete_next_word", gui_action_delete_next_word,
|
||||
N_("delete next word") },
|
||||
{ "clipboard_paste", gui_action_clipboard_paste,
|
||||
{ "clipboard_paste", gui_action_clipboard_paste,
|
||||
N_("paste current clipboard content") },
|
||||
{ "transpose_chars", gui_action_transpose_chars,
|
||||
{ "transpose_chars", gui_action_transpose_chars,
|
||||
N_("transpose chars") },
|
||||
{ "home", gui_action_home,
|
||||
{ "home", gui_action_home,
|
||||
N_("go to beginning of line") },
|
||||
{ "end", gui_action_end,
|
||||
{ "end", gui_action_end,
|
||||
N_("go to end of line") },
|
||||
{ "left", gui_action_left,
|
||||
{ "left", gui_action_left,
|
||||
N_("move one char left") },
|
||||
{ "previous_word", gui_action_previous_word,
|
||||
{ "previous_word", gui_action_previous_word,
|
||||
N_("move to previous word") },
|
||||
{ "right", gui_action_right,
|
||||
{ "right", gui_action_right,
|
||||
N_("move one char right") },
|
||||
{ "next_word", gui_action_next_word,
|
||||
{ "next_word", gui_action_next_word,
|
||||
N_("move to next word") },
|
||||
{ "up", gui_action_up,
|
||||
{ "up", gui_action_up,
|
||||
N_("call previous command in history") },
|
||||
{ "up_global", gui_action_up_global,
|
||||
{ "up_global", gui_action_up_global,
|
||||
N_("call previous command in global history") },
|
||||
{ "down", gui_action_down,
|
||||
{ "down", gui_action_down,
|
||||
N_("call next command in history") },
|
||||
{ "down_global", gui_action_down_global,
|
||||
{ "down_global", gui_action_down_global,
|
||||
N_("call next command in global history") },
|
||||
{ "page_up", gui_action_page_up,
|
||||
{ "page_up", gui_action_page_up,
|
||||
N_("scroll one page up") },
|
||||
{ "page_down", gui_action_page_down,
|
||||
{ "page_down", gui_action_page_down,
|
||||
N_("scroll one page down") },
|
||||
{ "nick_beginning", gui_action_nick_beginning,
|
||||
{ "nick_beginning", gui_action_nick_beginning,
|
||||
N_("display beginning of nicklist") },
|
||||
{ "nick_end", gui_action_nick_end,
|
||||
{ "nick_end", gui_action_nick_end,
|
||||
N_("display end of nicklist") },
|
||||
{ "nick_page_up", gui_action_nick_page_up,
|
||||
{ "nick_page_up", gui_action_nick_page_up,
|
||||
N_("scroll nicklist one page up") },
|
||||
{ "nick_page_down", gui_action_nick_page_down,
|
||||
{ "nick_page_down", gui_action_nick_page_down,
|
||||
N_("scroll nicklist one page down") },
|
||||
{ "jump_smart", gui_action_jump_smart,
|
||||
{ "jump_smart", gui_action_jump_smart,
|
||||
N_("jump to buffer with activity") },
|
||||
{ "jump_dcc", gui_action_jump_dcc,
|
||||
{ "jump_dcc", gui_action_jump_dcc,
|
||||
N_("jump to DCC buffer") },
|
||||
{ "jump_last_buffer", gui_action_jump_last_buffer,
|
||||
{ "jump_last_buffer", gui_action_jump_last_buffer,
|
||||
N_("jump to last buffer") },
|
||||
{ "jump_server", gui_action_jump_server,
|
||||
{ "jump_server", gui_action_jump_server,
|
||||
N_("jump to server buffer") },
|
||||
{ "jump_next_server", gui_action_jump_next_server,
|
||||
{ "jump_next_server", gui_action_jump_next_server,
|
||||
N_("jump to next server") },
|
||||
{ "switch_server", gui_action_switch_server,
|
||||
{ "switch_server", gui_action_switch_server,
|
||||
N_("switch active server on servers buffer") },
|
||||
{ "hotlist_clear", gui_action_hotlist_clear,
|
||||
{ "scroll_previous_highlight", gui_action_scroll_previous_highlight,
|
||||
N_("scroll to previous highlight in buffer") },
|
||||
{ "scroll_next_highlight", gui_action_scroll_next_highlight,
|
||||
N_("scroll to next highlight in buffer") },
|
||||
{ "scroll_unread", gui_action_scroll_unread,
|
||||
N_("scroll to first unread line in buffer") },
|
||||
{ "hotlist_clear", gui_action_hotlist_clear,
|
||||
N_("clear hotlist") },
|
||||
{ "infobar_clear", gui_action_infobar_clear,
|
||||
{ "infobar_clear", gui_action_infobar_clear,
|
||||
N_("clear infobar") },
|
||||
{ "refresh", gui_action_refresh_screen,
|
||||
{ "refresh", gui_action_refresh_screen,
|
||||
N_("refresh screen") },
|
||||
{ "grab_key", gui_action_grab_key,
|
||||
{ "grab_key", gui_action_grab_key,
|
||||
N_("grab a key") },
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
@@ -425,8 +431,8 @@ gui_key_bind (char *key, char *command)
|
||||
|
||||
if (!key || !command)
|
||||
{
|
||||
wee_log_printf (_("%s unable to bind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, key);
|
||||
weechat_log_printf (_("%s unable to bind key \"%s\"\n"),
|
||||
WEECHAT_ERROR, key);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -436,8 +442,8 @@ gui_key_bind (char *key, char *command)
|
||||
ptr_function = gui_key_function_search_by_name (command);
|
||||
if (!ptr_function)
|
||||
{
|
||||
wee_log_printf (_("%s unable to bind key \"%s\" (invalid function name: \"%s\")\n"),
|
||||
WEECHAT_ERROR, key, command);
|
||||
weechat_log_printf (_("%s unable to bind key \"%s\" (invalid function name: \"%s\")\n"),
|
||||
WEECHAT_ERROR, key, command);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -449,8 +455,8 @@ gui_key_bind (char *key, char *command)
|
||||
ptr_function);
|
||||
if (!new_key)
|
||||
{
|
||||
wee_log_printf (_("%s not enough memory for key binding\n"),
|
||||
WEECHAT_ERROR);
|
||||
weechat_log_printf (_("%s not enough memory for key binding\n"),
|
||||
WEECHAT_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -511,8 +517,8 @@ gui_key_pressed (char *key_str)
|
||||
/* exact combo found => execute function or command */
|
||||
gui_key_buffer[0] = '\0';
|
||||
if (ptr_key->command)
|
||||
user_command (SERVER(gui_current_window->buffer),
|
||||
gui_current_window->buffer,
|
||||
user_command (gui_current_window->buffer,
|
||||
SERVER(gui_current_window->buffer),
|
||||
ptr_key->command);
|
||||
else
|
||||
(void)(ptr_key->function)(gui_current_window);
|
||||
|
||||
+62
-22
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ typedef enum t_weechat_color t_weechat_color;
|
||||
|
||||
enum t_weechat_color
|
||||
{
|
||||
COLOR_WIN_TITLE = 0,
|
||||
COLOR_WIN_SEPARATOR = 0,
|
||||
COLOR_WIN_TITLE,
|
||||
COLOR_WIN_CHAT,
|
||||
COLOR_WIN_CHAT_TIME,
|
||||
COLOR_WIN_CHAT_TIME_SEP,
|
||||
@@ -58,6 +59,7 @@ enum t_weechat_color
|
||||
COLOR_WIN_CHAT_CHANNEL,
|
||||
COLOR_WIN_CHAT_DARK,
|
||||
COLOR_WIN_CHAT_HIGHLIGHT,
|
||||
COLOR_WIN_CHAT_READ_MARKER,
|
||||
COLOR_WIN_STATUS,
|
||||
COLOR_WIN_STATUS_DELIMITERS,
|
||||
COLOR_WIN_STATUS_CHANNEL,
|
||||
@@ -139,8 +141,8 @@ enum t_weechat_color
|
||||
#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
|
||||
|
||||
#define BUFFER_IS_SERVER(buffer) ((SERVER(buffer) || (buffer->all_servers)) && !CHANNEL(buffer))
|
||||
#define BUFFER_IS_CHANNEL(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_CHANNEL))
|
||||
#define BUFFER_IS_PRIVATE(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHAT_PRIVATE))
|
||||
#define BUFFER_IS_CHANNEL(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHANNEL_TYPE_CHANNEL))
|
||||
#define BUFFER_IS_PRIVATE(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHANNEL_TYPE_PRIVATE))
|
||||
|
||||
#define BUFFER_HAS_NICKLIST(buffer) (BUFFER_IS_CHANNEL(buffer))
|
||||
|
||||
@@ -164,6 +166,9 @@ enum t_weechat_color
|
||||
#define gui_printf_nolog_notime(buffer, fmt, argz...) \
|
||||
gui_printf_internal(buffer, 0, MSG_TYPE_NOLOG, fmt, ##argz)
|
||||
|
||||
#define WINDOW_MIN_WIDTH 10
|
||||
#define WINDOW_MIN_HEIGHT 5
|
||||
|
||||
#define NOTIFY_LEVEL_MIN 0
|
||||
#define NOTIFY_LEVEL_MAX 3
|
||||
#define NOTIFY_LEVEL_DEFAULT NOTIFY_LEVEL_MAX
|
||||
@@ -225,6 +230,7 @@ struct t_gui_buffer
|
||||
/* chat content (lines, line is composed by many messages) */
|
||||
t_gui_line *lines; /* lines of chat window */
|
||||
t_gui_line *last_line; /* last line of chat window */
|
||||
t_gui_line *last_read_line; /* last read line before jump */
|
||||
int num_lines; /* number of lines in the window */
|
||||
int line_complete; /* current line complete ? (\n ending) */
|
||||
|
||||
@@ -261,6 +267,7 @@ struct t_gui_buffer
|
||||
t_gui_buffer *next_buffer; /* link to next buffer */
|
||||
};
|
||||
|
||||
typedef struct t_gui_window_tree t_gui_window_tree;
|
||||
typedef struct t_gui_window t_gui_window;
|
||||
|
||||
struct t_gui_window
|
||||
@@ -268,6 +275,11 @@ struct t_gui_window
|
||||
/* global position & size */
|
||||
int win_x, win_y; /* position of window */
|
||||
int win_width, win_height; /* window geometry */
|
||||
int win_width_pct; /* % of width (compared to term size) */
|
||||
int win_height_pct; /* % of height (compared to term size) */
|
||||
|
||||
int new_x, new_y; /* used for computing new position */
|
||||
int new_width, new_height; /* used for computing new size */
|
||||
|
||||
/* chat window settings */
|
||||
int win_chat_x, win_chat_y; /* chat window position */
|
||||
@@ -319,11 +331,27 @@ struct t_gui_window
|
||||
int first_line_displayed; /* = 1 if first line is displayed */
|
||||
t_gui_line *start_line; /* pointer to line if scrolling */
|
||||
int start_line_pos; /* position in first line displayed */
|
||||
int scroll; /* = 1 if "MORE" should be displayed */
|
||||
t_gui_window_tree *ptr_tree; /* pointer to leaf in windows tree */
|
||||
|
||||
t_gui_window *prev_window; /* link to previous window */
|
||||
t_gui_window *next_window; /* link to next window */
|
||||
};
|
||||
|
||||
struct t_gui_window_tree
|
||||
{
|
||||
t_gui_window_tree *parent_node; /* pointer to parent node */
|
||||
|
||||
/* node info */
|
||||
int split_horiz; /* 1 if horizontal, 0 if vertical */
|
||||
int split_pct; /* % of split size (represents child1) */
|
||||
t_gui_window_tree *child1; /* first child, NULL if a leaf */
|
||||
t_gui_window_tree *child2; /* second child, NULL if a leaf */
|
||||
|
||||
/* leaf info */
|
||||
t_gui_window *window; /* pointer to window, NULL if a node */
|
||||
};
|
||||
|
||||
typedef struct t_gui_key t_gui_key;
|
||||
|
||||
struct t_gui_key
|
||||
@@ -353,6 +381,7 @@ extern int gui_add_hotlist;
|
||||
extern t_gui_window *gui_windows;
|
||||
extern t_gui_window *last_gui_window;
|
||||
extern t_gui_window *gui_current_window;
|
||||
extern t_gui_window_tree *gui_windows_tree;
|
||||
extern t_gui_buffer *gui_buffers;
|
||||
extern t_gui_buffer *last_gui_buffer;
|
||||
extern t_gui_buffer *buffer_before_dcc;
|
||||
@@ -369,7 +398,12 @@ extern t_gui_color *gui_color[NUM_COLORS];
|
||||
|
||||
/* GUI independent functions: windows & buffers */
|
||||
|
||||
extern t_gui_window *gui_window_new (int, int, int, int);
|
||||
extern int gui_window_tree_init (t_gui_window *);
|
||||
extern void gui_window_tree_node_to_leaf (t_gui_window_tree *, t_gui_window *);
|
||||
extern void gui_window_tree_free (t_gui_window_tree **);
|
||||
extern t_gui_window *gui_window_new (t_gui_window *, int, int, int, int, int, int);
|
||||
extern t_gui_buffer *gui_buffer_search (char *, char *);
|
||||
extern t_gui_window *gui_buffer_find_window (t_gui_buffer *);
|
||||
extern t_gui_buffer *gui_buffer_new (t_gui_window *, void *, void *, int, int);
|
||||
extern void gui_buffer_clear (t_gui_buffer *);
|
||||
extern void gui_buffer_clear_all ();
|
||||
@@ -377,7 +411,7 @@ extern void gui_infobar_printf (int, int, char *, ...);
|
||||
extern void gui_window_free (t_gui_window *);
|
||||
extern void gui_infobar_remove ();
|
||||
extern void gui_buffer_free (t_gui_buffer *, int);
|
||||
extern t_gui_line *gui_new_line (t_gui_buffer *);
|
||||
extern t_gui_line *gui_line_new (t_gui_buffer *);
|
||||
extern int gui_word_strlen (t_gui_window *, char *);
|
||||
extern int gui_word_real_pos (t_gui_window *, char *, int);
|
||||
extern void gui_printf_internal (t_gui_buffer *, int, int, char *, ...);
|
||||
@@ -387,14 +421,14 @@ extern int gui_insert_string_input (t_gui_window *, char *, int);
|
||||
extern void gui_merge_servers (t_gui_window *);
|
||||
extern void gui_split_server (t_gui_window *);
|
||||
extern void gui_window_switch_server (t_gui_window *);
|
||||
extern void gui_switch_to_previous_buffer (t_gui_window *);
|
||||
extern void gui_switch_to_next_buffer (t_gui_window *);
|
||||
extern void gui_switch_to_previous_window (t_gui_window *);
|
||||
extern void gui_switch_to_next_window (t_gui_window *);
|
||||
extern void gui_switch_to_window_by_buffer (t_gui_window *, int);
|
||||
extern void gui_switch_to_dcc_buffer (t_gui_window *);
|
||||
extern t_gui_buffer *gui_switch_to_buffer_by_number (t_gui_window *, int);
|
||||
extern void gui_move_buffer_to_number (t_gui_window *, int);
|
||||
extern void gui_buffer_switch_previous (t_gui_window *);
|
||||
extern void gui_buffer_switch_next (t_gui_window *);
|
||||
extern void gui_window_switch_previous (t_gui_window *);
|
||||
extern void gui_window_switch_next (t_gui_window *);
|
||||
extern void gui_window_switch_by_buffer (t_gui_window *, int);
|
||||
extern void gui_buffer_switch_dcc (t_gui_window *);
|
||||
extern t_gui_buffer *gui_buffer_switch_by_number (t_gui_window *, int);
|
||||
extern void gui_buffer_move_to_number (t_gui_window *, int);
|
||||
extern void gui_window_print_log (t_gui_window *);
|
||||
extern void gui_buffer_print_log (t_gui_buffer *);
|
||||
|
||||
@@ -434,6 +468,9 @@ extern void gui_action_jump_last_buffer (t_gui_window *);
|
||||
extern void gui_action_jump_server (t_gui_window *);
|
||||
extern void gui_action_jump_next_server (t_gui_window *);
|
||||
extern void gui_action_switch_server (t_gui_window *);
|
||||
extern void gui_action_scroll_previous_highlight (t_gui_window *);
|
||||
extern void gui_action_scroll_next_highlight (t_gui_window *);
|
||||
extern void gui_action_scroll_unread (t_gui_window *);
|
||||
extern void gui_action_hotlist_clear (t_gui_window *);
|
||||
extern void gui_action_infobar_clear (t_gui_window *);
|
||||
extern void gui_action_refresh_screen ();
|
||||
@@ -480,19 +517,22 @@ extern void gui_window_nick_end (t_gui_window *);
|
||||
extern void gui_window_nick_page_up (t_gui_window *);
|
||||
extern void gui_window_nick_page_down (t_gui_window *);
|
||||
extern void gui_window_init_subwindows (t_gui_window *);
|
||||
extern void gui_window_split_horiz (t_gui_window *);
|
||||
extern void gui_window_split_vertic (t_gui_window *);
|
||||
extern int gui_window_merge_up (t_gui_window *);
|
||||
extern int gui_window_merge_down (t_gui_window *);
|
||||
extern int gui_window_merge_left (t_gui_window *);
|
||||
extern int gui_window_merge_right (t_gui_window *);
|
||||
extern void gui_window_merge_auto (t_gui_window *);
|
||||
extern void gui_refresh_windows ();
|
||||
extern void gui_window_split_horiz (t_gui_window *, int);
|
||||
extern void gui_window_split_vertic (t_gui_window *, int);
|
||||
extern void gui_window_resize (t_gui_window *, int);
|
||||
extern int gui_window_merge (t_gui_window *);
|
||||
extern void gui_window_merge_all (t_gui_window *);
|
||||
extern void gui_window_switch_up (t_gui_window *);
|
||||
extern void gui_window_switch_down (t_gui_window *);
|
||||
extern void gui_window_switch_left (t_gui_window *);
|
||||
extern void gui_window_switch_right (t_gui_window *);
|
||||
extern void gui_refresh_screen ();
|
||||
extern void gui_pre_init (int *, char **[]);
|
||||
extern void gui_init_color_pairs ();
|
||||
extern void gui_rebuild_weechat_colors ();
|
||||
extern void gui_set_window_title ();
|
||||
extern void gui_reset_window_title ();
|
||||
extern void gui_init ();
|
||||
extern void gui_end ();
|
||||
extern void gui_input_default_key_bindings ();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,5 +12,5 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-display.c: display functions for wxWidgets GUI */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* gui-input: user input functions for wxWidgets GUI */
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(GNUTLS_CFLAGS)
|
||||
|
||||
+170
-103
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* irc-channel.c: manages a chat (channel or private chat) */
|
||||
@@ -30,6 +30,8 @@
|
||||
|
||||
#include "../common/weechat.h"
|
||||
#include "irc.h"
|
||||
#include "../common/utf8.h"
|
||||
#include "../common/weeconfig.h"
|
||||
#include "../gui/gui.h"
|
||||
|
||||
|
||||
@@ -41,8 +43,7 @@ char *channel_modes = "iklmnst";
|
||||
*/
|
||||
|
||||
t_irc_channel *
|
||||
channel_new (t_irc_server *server, int channel_type, char *channel_name,
|
||||
int switch_to_buffer)
|
||||
channel_new (t_irc_server *server, int channel_type, char *channel_name)
|
||||
{
|
||||
t_irc_channel *new_channel;
|
||||
|
||||
@@ -58,8 +59,9 @@ 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;
|
||||
memset (new_channel->modes, ' ', sizeof (new_channel->modes));
|
||||
new_channel->modes[sizeof (new_channel->modes) - 1] = '\0';
|
||||
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->limit = 0;
|
||||
new_channel->key = NULL;
|
||||
new_channel->nicks_count = 0;
|
||||
@@ -75,8 +77,6 @@ channel_new (t_irc_server *server, int channel_type, char *channel_name,
|
||||
else
|
||||
server->channels = new_channel;
|
||||
server->last_channel = new_channel;
|
||||
|
||||
gui_buffer_new (gui_current_window, server, new_channel, 0, switch_to_buffer);
|
||||
|
||||
/* all is ok, return address of new channel */
|
||||
return new_channel;
|
||||
@@ -173,6 +173,143 @@ string_is_channel (char *string)
|
||||
return (strpbrk (first_char, CHANNEL_PREFIX)) ? 1 : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* channel_get_charset_decode_iso: get decode iso value for channel
|
||||
* if not found for channel, look for server
|
||||
* if not found for server, look for global
|
||||
*/
|
||||
|
||||
char *
|
||||
channel_get_charset_decode_iso (t_irc_server *server, t_irc_channel *channel)
|
||||
{
|
||||
char *pos, *result;
|
||||
int length;
|
||||
|
||||
if (!server)
|
||||
return (cfg_look_charset_decode_iso) ?
|
||||
strdup (cfg_look_charset_decode_iso) : strdup ("");
|
||||
|
||||
if (!channel)
|
||||
return server_get_charset_decode_iso (server);
|
||||
|
||||
config_option_list_get_value (&(server->charset_decode_iso),
|
||||
channel->name, &pos, &length);
|
||||
if (pos && (length > 0))
|
||||
{
|
||||
result = strdup (pos);
|
||||
result[length] = '\0';
|
||||
return result;
|
||||
}
|
||||
|
||||
return server_get_charset_decode_iso (server);
|
||||
}
|
||||
|
||||
/*
|
||||
* channel_get_charset_decode_utf: get decode utf value for channel
|
||||
* if not found for channel, look for server
|
||||
* if not found for server, look for global
|
||||
*/
|
||||
|
||||
char *
|
||||
channel_get_charset_decode_utf (t_irc_server *server, t_irc_channel *channel)
|
||||
{
|
||||
char *pos, *result;
|
||||
int length;
|
||||
|
||||
if (!server)
|
||||
return (cfg_look_charset_decode_utf) ?
|
||||
strdup (cfg_look_charset_decode_utf) : strdup ("");
|
||||
|
||||
if (!channel)
|
||||
return server_get_charset_decode_utf (server);
|
||||
|
||||
config_option_list_get_value (&(server->charset_decode_utf),
|
||||
channel->name, &pos, &length);
|
||||
if (pos && (length > 0))
|
||||
{
|
||||
result = strdup (pos);
|
||||
result[length] = '\0';
|
||||
return result;
|
||||
}
|
||||
|
||||
return server_get_charset_decode_utf (server);
|
||||
}
|
||||
|
||||
/*
|
||||
* channel_get_charset_encode: get encode value for channel
|
||||
* if not found for channel, look for server
|
||||
* if not found for server, look for global
|
||||
*/
|
||||
|
||||
char *
|
||||
channel_get_charset_encode (t_irc_server *server, t_irc_channel *channel)
|
||||
{
|
||||
char *pos, *result;
|
||||
int length;
|
||||
|
||||
if (!server)
|
||||
return (cfg_look_charset_encode) ?
|
||||
strdup (cfg_look_charset_encode) : strdup ("");
|
||||
|
||||
if (!channel)
|
||||
return server_get_charset_encode (server);
|
||||
|
||||
config_option_list_get_value (&(server->charset_encode),
|
||||
channel->name, &pos, &length);
|
||||
if (pos && (length > 0))
|
||||
{
|
||||
result = strdup (pos);
|
||||
result[length] = '\0';
|
||||
return result;
|
||||
}
|
||||
|
||||
return server_get_charset_encode (server);
|
||||
}
|
||||
|
||||
/*
|
||||
* channel_iconv_decode: convert string to local charset
|
||||
*/
|
||||
|
||||
char *
|
||||
channel_iconv_decode (t_irc_server *server, t_irc_channel *channel, char *string)
|
||||
{
|
||||
char *from_charset, *string2;
|
||||
|
||||
if (!local_utf8 || !utf8_is_valid (string))
|
||||
{
|
||||
if (local_utf8)
|
||||
from_charset = channel_get_charset_decode_iso (server, channel);
|
||||
else
|
||||
from_charset = channel_get_charset_decode_utf (server, channel);
|
||||
string2 = weechat_iconv (from_charset,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
string);
|
||||
free (from_charset);
|
||||
return string2;
|
||||
}
|
||||
else
|
||||
return strdup (string);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
char *
|
||||
channel_iconv_encode (t_irc_server *server, t_irc_channel *channel, char *string)
|
||||
{
|
||||
char *to_charset, *string2;
|
||||
|
||||
to_charset = channel_get_charset_encode (server, channel);
|
||||
string2 = weechat_iconv ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
to_charset,
|
||||
string);
|
||||
free (to_charset);
|
||||
return string2;
|
||||
}
|
||||
|
||||
/*
|
||||
* channel_remove_away: remove away for all nicks on a channel
|
||||
*/
|
||||
@@ -182,11 +319,11 @@ channel_remove_away (t_irc_channel *channel)
|
||||
{
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
if (channel->type == CHAT_CHANNEL)
|
||||
if (channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
ptr_nick->is_away = 0;
|
||||
NICK_SET_FLAG(ptr_nick, 0, NICK_AWAY);
|
||||
}
|
||||
gui_draw_buffer_nick (channel->buffer, 0);
|
||||
}
|
||||
@@ -199,7 +336,7 @@ channel_remove_away (t_irc_channel *channel)
|
||||
void
|
||||
channel_check_away (t_irc_server *server, t_irc_channel *channel)
|
||||
{
|
||||
if (channel->type == CHAT_CHANNEL)
|
||||
if (channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
channel->checking_away++;
|
||||
server_sendf (server, "WHO %s\r\n", channel->name);
|
||||
@@ -215,7 +352,7 @@ channel_set_away (t_irc_channel *channel, char *nick, int is_away)
|
||||
{
|
||||
t_irc_nick *ptr_nick;
|
||||
|
||||
if (channel->type == CHAT_CHANNEL)
|
||||
if (channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
ptr_nick = nick_search (channel, nick);
|
||||
if (ptr_nick)
|
||||
@@ -234,10 +371,11 @@ channel_create_dcc (t_irc_dcc *ptr_dcc)
|
||||
|
||||
ptr_channel = channel_search (ptr_dcc->server, ptr_dcc->nick);
|
||||
if (!ptr_channel)
|
||||
ptr_channel = channel_new (ptr_dcc->server, CHAT_PRIVATE,
|
||||
ptr_dcc->nick, 0);
|
||||
ptr_channel = channel_new (ptr_dcc->server, CHANNEL_TYPE_PRIVATE,
|
||||
ptr_dcc->nick);
|
||||
if (!ptr_channel)
|
||||
return 0;
|
||||
gui_buffer_new (gui_current_window, ptr_dcc->server, ptr_channel, 0, 0);
|
||||
|
||||
if (ptr_channel->dcc_chat &&
|
||||
(!DCC_ENDED(((t_irc_dcc *)(ptr_channel->dcc_chat))->status)))
|
||||
@@ -306,44 +444,6 @@ channel_get_notify_level (t_irc_server *server, t_irc_channel *channel)
|
||||
return notify;
|
||||
}
|
||||
|
||||
/*
|
||||
* server_remove_notify_level: remove channel notify from list
|
||||
*/
|
||||
|
||||
void
|
||||
channel_remove_notify_level (t_irc_server *server, t_irc_channel *channel)
|
||||
{
|
||||
char *name, *pos, *pos2;
|
||||
|
||||
if ((!server) || (!channel))
|
||||
return;
|
||||
|
||||
name = (char *) malloc (strlen (channel->name) + 2);
|
||||
strcpy (name, channel->name);
|
||||
strcat (name, ":");
|
||||
pos = strstr (server->notify_levels, name);
|
||||
free (name);
|
||||
if (pos)
|
||||
{
|
||||
pos2 = pos + strlen (channel->name);
|
||||
if (pos2[0] == ':')
|
||||
{
|
||||
pos2++;
|
||||
if (pos2[0])
|
||||
{
|
||||
pos2++;
|
||||
if (pos2[0] == ',')
|
||||
pos2++;
|
||||
if (!pos2[0] && (pos != server->notify_levels))
|
||||
pos--;
|
||||
strcpy (pos, pos2);
|
||||
server->notify_levels = (char *) realloc (server->notify_levels,
|
||||
strlen (server->notify_levels) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* server_set_notify_level: set channel notify level
|
||||
*/
|
||||
@@ -351,52 +451,19 @@ channel_remove_notify_level (t_irc_server *server, t_irc_channel *channel)
|
||||
void
|
||||
channel_set_notify_level (t_irc_server *server, t_irc_channel *channel, int notify)
|
||||
{
|
||||
char *name, *pos, *pos2, level_string[2];
|
||||
char level_string[2];
|
||||
|
||||
if ((!server) || (!channel))
|
||||
return;
|
||||
|
||||
if (notify == NOTIFY_LEVEL_DEFAULT)
|
||||
{
|
||||
channel_remove_notify_level (server, channel);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!server->notify_levels)
|
||||
{
|
||||
server->notify_levels = (char *) malloc (strlen (channel->name) + 3);
|
||||
server->notify_levels[0] = '\0';
|
||||
}
|
||||
config_option_list_remove (&(server->notify_levels), channel->name);
|
||||
else
|
||||
{
|
||||
name = (char *) malloc (strlen (channel->name) + 2);
|
||||
strcpy (name, channel->name);
|
||||
strcat (name, ":");
|
||||
pos = strstr (server->notify_levels, name);
|
||||
free (name);
|
||||
if (pos)
|
||||
{
|
||||
pos2 = pos + strlen (channel->name) + 1;
|
||||
if (pos2[0])
|
||||
{
|
||||
pos2[0] = '0' + notify;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* realloc notify list to add channel */
|
||||
server->notify_levels = (char *) realloc (server->notify_levels,
|
||||
strlen (server->notify_levels) + 1 +
|
||||
strlen (channel->name) + 2 + 1);
|
||||
level_string[0] = notify + '0';
|
||||
level_string[1] = '\0';
|
||||
config_option_list_set (&(server->notify_levels), channel->name, level_string);
|
||||
}
|
||||
|
||||
/* channel not in notify list => add it */
|
||||
if (server->notify_levels[0])
|
||||
strcat (server->notify_levels, ",");
|
||||
strcat (server->notify_levels, channel->name);
|
||||
strcat (server->notify_levels, ":");
|
||||
level_string[0] = notify + '0';
|
||||
level_string[1] = '\0';
|
||||
strcat (server->notify_levels, level_string);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -406,17 +473,17 @@ channel_set_notify_level (t_irc_server *server, t_irc_channel *channel, int noti
|
||||
void
|
||||
channel_print_log (t_irc_channel *channel)
|
||||
{
|
||||
wee_log_printf ("=> channel %s (addr:0x%X)]\n", channel->name, channel);
|
||||
wee_log_printf (" type . . . . : %d\n", channel->type);
|
||||
wee_log_printf (" dcc_chat . . : 0x%X\n", channel->dcc_chat);
|
||||
wee_log_printf (" topic. . . . : '%s'\n", channel->topic);
|
||||
wee_log_printf (" modes. . . . : '%s'\n", channel->modes);
|
||||
wee_log_printf (" limit. . . . : %d\n", channel->limit);
|
||||
wee_log_printf (" key. . . . . : '%s'\n", channel->key);
|
||||
wee_log_printf (" checking_away: %d\n", channel->checking_away);
|
||||
wee_log_printf (" nicks. . . . : 0x%X\n", channel->nicks);
|
||||
wee_log_printf (" last_nick. . : 0x%X\n", channel->last_nick);
|
||||
wee_log_printf (" buffer . . . : 0x%X\n", channel->buffer);
|
||||
wee_log_printf (" prev_channel : 0x%X\n", channel->prev_channel);
|
||||
wee_log_printf (" next_channel : 0x%X\n", channel->next_channel);
|
||||
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 (" 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);
|
||||
}
|
||||
|
||||
+400
-319
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* irc-commands.c: implementation of IRC commands, according to
|
||||
@@ -34,462 +34,543 @@ t_irc_command irc_commands[] =
|
||||
{ { "admin", N_("find information about the administrator of the server"),
|
||||
N_("[target]"),
|
||||
N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_admin, NULL },
|
||||
NULL, 0, 1, 1, NULL, irc_cmd_send_admin, NULL },
|
||||
{ "ame", N_("send a CTCP action to all channels of all connected servers"),
|
||||
N_("message"),
|
||||
N_("message: message to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_ame, NULL },
|
||||
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_ame, NULL },
|
||||
{ "amsg", N_("send message to all channels of all connected servers"),
|
||||
N_("text"),
|
||||
N_("text: text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_amsg, NULL },
|
||||
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_amsg, NULL },
|
||||
{ "away", N_("toggle away status"),
|
||||
N_("[-all] [message]"),
|
||||
N_("-all: toggle away status on all connected servers\n"
|
||||
"message: message for away (if no message is given, away status is removed)"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
|
||||
N_(" -all: toggle away status on all connected servers\n"
|
||||
"message: message for away (if no message is given, away status is removed)"),
|
||||
"%y", 0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
|
||||
{ "ban", N_("bans nicks or hosts"),
|
||||
N_("[channel] [nickname [nickname ...]]"),
|
||||
N_("channel: channel for ban\n"
|
||||
N_(" channel: channel for ban\n"
|
||||
"nickname: user or host to ban"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_ban, NULL },
|
||||
"", 0, MAX_ARGS, 1, NULL, irc_cmd_send_ban, NULL },
|
||||
{ "ctcp", N_("send a CTCP message (Client-To-Client Protocol)"),
|
||||
N_("nickname type [arguments]"),
|
||||
N_("nickname: user to send CTCP to\n"
|
||||
"type: CTCP type (examples: \"version\", \"ping\", ..)\n"
|
||||
N_(" nickname: user to send CTCP to\n"
|
||||
" type: CTCP type (examples: \"version\", \"ping\", ..)\n"
|
||||
"arguments: arguments for CTCP"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_ctcp, NULL },
|
||||
"%n action|ping|version", 2, MAX_ARGS, 1, NULL, irc_cmd_send_ctcp, NULL },
|
||||
{ "dcc", N_("starts DCC (file or chat) or close chat"),
|
||||
N_("action [nickname [file]]"),
|
||||
N_("action: 'send' (file) or 'chat' or 'close' (chat)\n"
|
||||
"nickname: nickname to send file or chat\n"
|
||||
"file: filename (on local host)"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_dcc, NULL },
|
||||
N_(" action: 'send' (file) or 'chat' or 'close' (chat)\n"
|
||||
"nickname: nickname to send file or chat\n"
|
||||
" file: filename (on local host)"),
|
||||
"chat|send|close %n %f", 1, MAX_ARGS, 1, NULL, irc_cmd_send_dcc, NULL },
|
||||
{ "dehalfop", N_("removes half channel operator status from nickname(s)"),
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
|
||||
"", 0, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
|
||||
{ "deop", N_("removes channel operator status from nickname(s)"),
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
|
||||
"", 0, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
|
||||
{ "devoice", N_("removes voice from nickname(s)"),
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
|
||||
{ "die", N_("shutdown the server"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, irc_cmd_send_die, NULL },
|
||||
{ "error", N_("error received from IRC server"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
"", 0, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
|
||||
{ "die", N_("shutdown the server"), "", "",
|
||||
NULL, 0, 0, 1, NULL, irc_cmd_send_die, NULL },
|
||||
{ "error", N_("error received from IRC server"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "halfop", N_("gives half channel operator status to nickname(s)"),
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
|
||||
"", 0, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
|
||||
{ "info", N_("get information describing the server"),
|
||||
N_("[target]"),
|
||||
N_("target: server name"),
|
||||
0, 1, 1, NULL, irc_cmd_send_info, NULL },
|
||||
NULL, 0, 1, 1, NULL, irc_cmd_send_info, NULL },
|
||||
{ "invite", N_("invite a nick on a channel"),
|
||||
N_("nickname channel"),
|
||||
N_("nickname: nick to invite\n"
|
||||
"channel: channel to invite"),
|
||||
1, 2, 1, irc_cmd_send_invite, NULL, irc_cmd_recv_invite },
|
||||
" channel: channel to invite"),
|
||||
"%n %c", 1, 2, 1, irc_cmd_send_invite, NULL, irc_cmd_recv_invite },
|
||||
{ "ison", N_("check if a nickname is currently on IRC"),
|
||||
N_("nickname [nickname ...]"),
|
||||
N_("nickname: nickname"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
|
||||
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
|
||||
{ "join", N_("join a channel"),
|
||||
N_("channel[,channel] [key[,key]]"),
|
||||
N_("channel: channel name to join\n"
|
||||
"key: key to join the channel"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_join, irc_cmd_recv_join },
|
||||
" key: key to join the channel"),
|
||||
NULL, 1, MAX_ARGS, 1, NULL, irc_cmd_send_join, irc_cmd_recv_join },
|
||||
{ "kick", N_("forcibly remove a user from a channel"),
|
||||
N_("[channel] nickname [comment]"),
|
||||
N_("channel: channel where user is\n"
|
||||
N_(" channel: channel where user is\n"
|
||||
"nickname: nickname to kick\n"
|
||||
"comment: comment for kick"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_kick, irc_cmd_recv_kick },
|
||||
" comment: comment for kick"),
|
||||
"%n %-", 1, MAX_ARGS, 1, NULL, irc_cmd_send_kick, irc_cmd_recv_kick },
|
||||
{ "kickban", N_("kicks and bans a nick from a channel"),
|
||||
N_("[channel] nickname [comment]"),
|
||||
N_("channel: channel where user is\n"
|
||||
N_(" channel: channel where user is\n"
|
||||
"nickname: nickname to kick and ban\n"
|
||||
"comment: comment for kick"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_kickban, NULL },
|
||||
" comment: comment for kick"),
|
||||
"%n %-", 1, MAX_ARGS, 1, NULL, irc_cmd_send_kickban, NULL },
|
||||
{ "kill", N_("close client-server connection"),
|
||||
N_("nickname comment"),
|
||||
N_("nickname: nickname\n"
|
||||
"comment: comment for kill"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
|
||||
" comment: comment for kill"),
|
||||
"%n %-", 2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
|
||||
{ "links", N_("list all servernames which are known by the server answering the query"),
|
||||
N_("[[server] server_mask]"),
|
||||
N_("server: this server should answer the query\n"
|
||||
"server_mask: list of servers must match this mask"),
|
||||
0, 2, 1, NULL, irc_cmd_send_links, NULL },
|
||||
N_(" server: this server should answer the query\n"
|
||||
"server_mask: list of servers must match this mask"),
|
||||
NULL, 0, 2, 1, NULL, irc_cmd_send_links, NULL },
|
||||
{ "list", N_("list channels and their topic"),
|
||||
N_("[channel[,channel] [server]]"),
|
||||
N_("channel: channel to list\nserver: server name"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_list, NULL },
|
||||
NULL, 0, MAX_ARGS, 1, NULL, irc_cmd_send_list, NULL },
|
||||
{ "lusers", N_("get statistics about the size of the IRC network"),
|
||||
N_("[mask [target]]"),
|
||||
N_("mask: servers matching the mask only\n"
|
||||
"target: server for forwarding request"),
|
||||
0, 2, 1, NULL, irc_cmd_send_lusers, NULL },
|
||||
N_(" mask: servers matching the mask only\n"
|
||||
"target: server for forwarding request"),
|
||||
NULL, 0, 2, 1, NULL, irc_cmd_send_lusers, NULL },
|
||||
{ "me", N_("send a CTCP action to the current channel"),
|
||||
N_("message"),
|
||||
N_("message: message to send"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
|
||||
"", 0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
|
||||
{ "mode", N_("change channel or user mode"),
|
||||
N_("{ channel {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask] } | "
|
||||
"{ nickname {[+|-]|i|w|s|o} }"),
|
||||
"{ nickname {[+|-]|i|w|s|o} }"),
|
||||
N_("channel modes:\n"
|
||||
" channel: channel name to modify\n"
|
||||
" o: give/take channel operator privileges\n"
|
||||
" p: private channel flag\n"
|
||||
" s: secret channel flag\n"
|
||||
" i: invite-only channel flag\n"
|
||||
" t: topic settable by channel operator only flag\n"
|
||||
" n: no messages to channel from clients on the outside\n"
|
||||
" m: moderated channel\n"
|
||||
" l: set the user limit to channel\n"
|
||||
" b: set a ban mask to keep users out\n"
|
||||
" e: set exception mask\n"
|
||||
" v: give/take the ability to speak on a moderated channel\n"
|
||||
" k: set a channel key (password)\n"
|
||||
"user modes:\n"
|
||||
" nickname: nickname to modify\n"
|
||||
" i: mark a user as invisible\n"
|
||||
" s: mark a user for receive server notices\n"
|
||||
" w: user receives wallops\n"
|
||||
" o: operator flag"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
|
||||
" channel: channel name to modify\n"
|
||||
" o: give/take channel operator privileges\n"
|
||||
" p: private channel flag\n"
|
||||
" s: secret channel flag\n"
|
||||
" i: invite-only channel flag\n"
|
||||
" t: topic settable by channel operator only flag\n"
|
||||
" n: no messages to channel from clients on the outside\n"
|
||||
" m: moderated channel\n"
|
||||
" l: set the user limit to channel\n"
|
||||
" b: set a ban mask to keep users out\n"
|
||||
" e: set exception mask\n"
|
||||
" v: give/take the ability to speak on a moderated channel\n"
|
||||
" k: set a channel key (password)\n"
|
||||
"user modes:\n"
|
||||
" nickname: nickname to modify\n"
|
||||
" i: mark a user as invisible\n"
|
||||
" s: mark a user for receive server notices\n"
|
||||
" w: user receives wallops\n"
|
||||
" o: operator flag"),
|
||||
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
|
||||
{ "motd", N_("get the \"Message Of The Day\""),
|
||||
N_("[target]"),
|
||||
N_("target: server name"),
|
||||
0, 1, 1, NULL, irc_cmd_send_motd, NULL },
|
||||
NULL, 0, 1, 1, NULL, irc_cmd_send_motd, NULL },
|
||||
{ "msg", N_("send message to a nick or channel"),
|
||||
N_("receiver[,receiver] text"),
|
||||
N_("receiver: nick or channel (may be mask, '*' = current channel)\n"
|
||||
"text: text to send"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
|
||||
"text: text to send"),
|
||||
"", 2, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
|
||||
{ "names", N_("list nicknames on channels"),
|
||||
N_("[channel[,channel]]"), N_("channel: channel name"),
|
||||
0, 1, 1, NULL, irc_cmd_send_names, NULL },
|
||||
N_("[channel[,channel]]"),
|
||||
N_("channel: channel name"),
|
||||
NULL, 0, 1, 1, NULL, irc_cmd_send_names, NULL },
|
||||
{ "nick", N_("change current nickname"),
|
||||
N_("[-all] nickname"),
|
||||
N_("-all: set new nickname for all connected servers\n"
|
||||
"nickname: new nickname"),
|
||||
1, 2, 1, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
|
||||
N_(" -all: set new nickname for all connected servers\n"
|
||||
"nickname: new nickname"),
|
||||
NULL, 1, 2, 0, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
|
||||
{ "notice", N_("send notice message to user"),
|
||||
N_("nickname text"), N_("nickname: user to send notice to\ntext: text to send"),
|
||||
2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
|
||||
N_("nickname text"),
|
||||
N_("nickname: user to send notice to\n"
|
||||
" text: text to send"),
|
||||
"%n %-", 2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
|
||||
{ "op", N_("gives channel operator status to nickname(s)"),
|
||||
N_("nickname [nickname]"), "",
|
||||
1, MAX_ARGS, 1, irc_cmd_send_op, NULL, NULL },
|
||||
"", 1, MAX_ARGS, 1, irc_cmd_send_op, NULL, NULL },
|
||||
{ "oper", N_("get operator privileges"),
|
||||
N_("user password"),
|
||||
N_("user/password: used to get privileges on current IRC server"),
|
||||
2, 2, 1, NULL, irc_cmd_send_oper, NULL },
|
||||
NULL, 2, 2, 1, NULL, irc_cmd_send_oper, NULL },
|
||||
{ "part", N_("leave a channel"),
|
||||
N_("[channel[,channel]] [part_message]"),
|
||||
N_("channel: channel name to leave\n"
|
||||
N_(" channel: channel name to leave\n"
|
||||
"part_message: part message (displayed to other users)"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_part, irc_cmd_recv_part },
|
||||
"%p", 0, MAX_ARGS, 1, NULL, irc_cmd_send_part, irc_cmd_recv_part },
|
||||
{ "ping", N_("ping server"),
|
||||
N_("server1 [server2]"),
|
||||
N_("server1: server to ping\nserver2: forward ping to this server"),
|
||||
1, 2, 1, NULL, irc_cmd_send_ping, irc_cmd_recv_ping },
|
||||
NULL, 1, 2, 1, NULL, irc_cmd_send_ping, irc_cmd_recv_ping },
|
||||
{ "pong", N_("answer to a ping message"),
|
||||
N_("daemon [daemon2]"),
|
||||
N_("daemon: daemon who has responded to Ping message\n"
|
||||
N_(" daemon: daemon who has responded to Ping message\n"
|
||||
"daemon2: forward message to this daemon"),
|
||||
1, 2, 1, NULL, irc_cmd_send_pong, irc_cmd_recv_pong },
|
||||
{ "privmsg", N_("message received"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
|
||||
NULL, 1, 2, 1, NULL, irc_cmd_send_pong, irc_cmd_recv_pong },
|
||||
{ "privmsg", N_("message received"), "", "",
|
||||
"", 0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
|
||||
{ "query", N_("send a private message to a nick"),
|
||||
N_("nickname [text]"),
|
||||
N_("nickname: nickname for private conversation\n"
|
||||
"text: text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_query, NULL },
|
||||
{ "quit", N_("close all connections & quit"),
|
||||
" text: text to send"),
|
||||
"%n %-", 1, MAX_ARGS, 1, NULL, irc_cmd_send_query, NULL },
|
||||
{ "quit", N_("close all connections and quit"),
|
||||
N_("[quit_message]"),
|
||||
N_("quit_message: quit message (displayed to other users)"),
|
||||
0, MAX_ARGS, 0, NULL, irc_cmd_send_quit, irc_cmd_recv_quit },
|
||||
"%q", 0, MAX_ARGS, 0, NULL, irc_cmd_send_quit, irc_cmd_recv_quit },
|
||||
{ "quote", N_("send raw data to server without parsing"),
|
||||
N_("data"),
|
||||
N_("data: raw data to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_quote, NULL },
|
||||
{ "rehash", N_("tell the server to reload its config file"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, irc_cmd_send_rehash, NULL },
|
||||
{ "restart", N_("tell the server to restart itself"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, irc_cmd_send_restart, NULL },
|
||||
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_quote, NULL },
|
||||
{ "rehash", N_("tell the server to reload its config file"), "", "",
|
||||
NULL, 0, 0, 1, NULL, irc_cmd_send_rehash, NULL },
|
||||
{ "restart", N_("tell the server to restart itself"), "", "",
|
||||
NULL, 0, 0, 1, NULL, irc_cmd_send_restart, NULL },
|
||||
{ "service", N_("register a new service"),
|
||||
N_("nickname reserved distribution type reserved info"),
|
||||
N_("distribution: visibility of service\n"
|
||||
"type: reserved for future usage"),
|
||||
6, 6, 1, NULL, irc_cmd_send_service, NULL },
|
||||
" type: reserved for future usage"),
|
||||
NULL, 6, 6, 1, NULL, irc_cmd_send_service, NULL },
|
||||
{ "servlist", N_("list services currently connected to the network"),
|
||||
N_("[mask [type]]"),
|
||||
N_("mask: list only services matching this mask\n"
|
||||
"type: list only services of this type"),
|
||||
0, 2, 1, NULL, irc_cmd_send_servlist, NULL },
|
||||
NULL, 0, 2, 1, NULL, irc_cmd_send_servlist, NULL },
|
||||
{ "squery", N_("deliver a message to a service"),
|
||||
N_("service text"),
|
||||
N_("service: name of service\ntext: text to send"),
|
||||
2, 2, 1, NULL, irc_cmd_send_squery, NULL },
|
||||
NULL, 2, 2, 1, NULL, irc_cmd_send_squery, NULL },
|
||||
{ "squit", N_("disconnect server links"),
|
||||
N_("server comment"),
|
||||
N_("server: server name\ncomment: comment for quit"),
|
||||
2, 2, 1, NULL, irc_cmd_send_squit, NULL },
|
||||
N_( "server: server name\n"
|
||||
"comment: comment for quit"),
|
||||
NULL, 2, 2, 1, NULL, irc_cmd_send_squit, NULL },
|
||||
{ "stats", N_("query statistics about server"),
|
||||
N_("[query [server]]"),
|
||||
N_("query: c/h/i/k/l/m/o/y/u (see RFC1459)\nserver: server name"),
|
||||
0, 2, 1, NULL, irc_cmd_send_stats, NULL },
|
||||
N_(" query: c/h/i/k/l/m/o/y/u (see RFC1459)\n"
|
||||
"server: server name"),
|
||||
NULL, 0, 2, 1, NULL, irc_cmd_send_stats, NULL },
|
||||
{ "summon", N_("give users who are on a host running an IRC server a message "
|
||||
"asking them to please join IRC"),
|
||||
N_("user [target [channel]]"),
|
||||
N_("user: username\ntarget: server name\n"
|
||||
N_(" user: username\ntarget: server name\n"
|
||||
"channel: channel name"),
|
||||
1, 3, 1, NULL, irc_cmd_send_summon, NULL },
|
||||
NULL, 1, 3, 1, NULL, irc_cmd_send_summon, NULL },
|
||||
{ "time", N_("query local time from server"),
|
||||
N_("[target]"), N_("target: query time from specified server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_time, NULL },
|
||||
N_("[target]"),
|
||||
N_("target: query time from specified server"),
|
||||
NULL, 0, 1, 1, NULL, irc_cmd_send_time, NULL },
|
||||
{ "topic", N_("get/set channel topic"),
|
||||
N_("[channel] [topic]"),
|
||||
N_("channel: channel name\ntopic: new topic for channel "
|
||||
"(if topic is \"-delete\" then topic is deleted)"),
|
||||
0, MAX_ARGS, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
|
||||
"%t", 0, MAX_ARGS, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
|
||||
{ "trace", N_("find the route to specific server"),
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_trace, NULL },
|
||||
N_("[target]"),
|
||||
N_("target: server"),
|
||||
NULL, 0, 1, 1, NULL, irc_cmd_send_trace, NULL },
|
||||
{ "unban", N_("unbans nicks or hosts"),
|
||||
N_("[channel] nickname [nickname ...]"),
|
||||
N_("channel: channel for unban\n"
|
||||
N_(" channel: channel for unban\n"
|
||||
"nickname: user or host to unban"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_unban, NULL },
|
||||
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_unban, NULL },
|
||||
{ "userhost", N_("return a list of information about nicknames"),
|
||||
N_("nickname [nickname ...]"), N_("nickname: nickname"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_userhost, NULL },
|
||||
N_("nickname [nickname ...]"),
|
||||
N_("nickname: nickname"),
|
||||
NULL, 1, MAX_ARGS, 1, NULL, irc_cmd_send_userhost, NULL },
|
||||
{ "users", N_("list of users logged into the server"),
|
||||
N_("[target]"), N_("target: server"),
|
||||
0, 1, 1, NULL, irc_cmd_send_users, NULL },
|
||||
N_("[target]"),
|
||||
N_("target: server"),
|
||||
NULL, 0, 1, 1, NULL, irc_cmd_send_users, NULL },
|
||||
{ "version", N_("gives the version info of nick or server (current or specified)"),
|
||||
N_("[server | nickname]"),
|
||||
N_("server: server name\n"
|
||||
N_(" server: server name\n"
|
||||
"nickname: nickname"),
|
||||
0, 1, 1, NULL, irc_cmd_send_version, NULL },
|
||||
NULL, 0, 1, 1, NULL, irc_cmd_send_version, NULL },
|
||||
{ "voice", N_("gives voice to nickname(s)"),
|
||||
N_("[nickname [nickname]]"), "",
|
||||
0, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
|
||||
"", 0, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
|
||||
{ "wallops", N_("send a message to all currently connected users who have "
|
||||
"set the 'w' user mode for themselves"),
|
||||
N_("text"), N_("text to send"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
|
||||
N_("text"),
|
||||
N_("text to send"),
|
||||
NULL, 1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
|
||||
{ "who", N_("generate a query which returns a list of information"),
|
||||
N_("[mask [\"o\"]]"),
|
||||
N_("mask: only information which match this mask\n"
|
||||
"o: only operators are returned according to the mask supplied"),
|
||||
0, 2, 1, NULL, irc_cmd_send_who, NULL },
|
||||
" o: only operators are returned according to the mask supplied"),
|
||||
"%C", 0, 2, 1, NULL, irc_cmd_send_who, NULL },
|
||||
{ "whois", N_("query information about user(s)"),
|
||||
N_("[server] nickname[,nickname]"),
|
||||
N_("server: server name\n"
|
||||
N_(" server: server name\n"
|
||||
"nickname: nickname (may be a mask)"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_whois, NULL },
|
||||
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_whois, NULL },
|
||||
{ "whowas", N_("ask for information about a nickname which no longer exists"),
|
||||
N_("nickname [,nickname [,nickname ...]] [count [target]]"),
|
||||
N_("nickname: nickname to search\n"
|
||||
"count: number of replies to return (full search if negative number)\n"
|
||||
"target: reply should match this mask"),
|
||||
1, MAX_ARGS, 1, NULL, irc_cmd_send_whowas, NULL },
|
||||
{ "001", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "002", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "003", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "004", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
|
||||
{ "005", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "008", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "020", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "042", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "212", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "219", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "221", N_("user mode string"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
|
||||
{ "250", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "251", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "252", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "253", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "254", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "255", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "256", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "257", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "258", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "259", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "260", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "261", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "262", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "263", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "264", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "265", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "266", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "267", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "268", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "269", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "301", N_("away message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
|
||||
{ "302", N_("userhost"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
|
||||
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
|
||||
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
|
||||
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
|
||||
{ "307", N_("whois (registered nick)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
|
||||
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
|
||||
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
|
||||
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
|
||||
{ "314", N_("whowas"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
|
||||
{ "315", N_("end of /who list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
|
||||
{ "317", N_("whois (idle)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
|
||||
{ "318", N_("whois (end)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
|
||||
{ "319", N_("whois (channels)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
|
||||
{ "320", N_("whois (identified user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
|
||||
{ "321", N_("/list start"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
|
||||
{ "322", N_("channel (for /list)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
|
||||
{ "323", N_("/list end"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
|
||||
{ "324", N_("channel mode"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
|
||||
{ "329", "???", "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
|
||||
{ "331", N_("no topic for channel"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
|
||||
" count: number of replies to return (full search if negative number)\n"
|
||||
" target: reply should match this mask"),
|
||||
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_whowas, NULL },
|
||||
{ "001", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "002", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "003", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "004", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
|
||||
{ "005", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "008", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "020", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "042", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "212", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "219", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "221", N_("user mode string"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
|
||||
{ "250", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "251", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "252", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "253", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "254", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "255", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "256", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "257", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "258", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "259", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "260", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "261", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "262", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "263", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "264", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "265", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "266", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "267", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "268", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "269", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "301", N_("away message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
|
||||
{ "302", N_("userhost"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
|
||||
{ "303", N_("ison"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
|
||||
{ "305", N_("unaway"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
|
||||
{ "306", N_("now away"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
|
||||
{ "307", N_("whois (registered nick)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
|
||||
{ "311", N_("whois (user)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
|
||||
{ "312", N_("whois (server)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
|
||||
{ "313", N_("whois (operator)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
|
||||
{ "314", N_("whowas"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
|
||||
{ "315", N_("end of /who list"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
|
||||
{ "317", N_("whois (idle)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
|
||||
{ "318", N_("whois (end)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
|
||||
{ "319", N_("whois (channels)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
|
||||
{ "320", N_("whois (identified user)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
|
||||
{ "321", N_("/list start"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
|
||||
{ "322", N_("channel (for /list)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
|
||||
{ "323", N_("/list end"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
|
||||
{ "324", N_("channel mode"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
|
||||
{ "329", "???", "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
|
||||
{ "331", N_("no topic for channel"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
|
||||
{ "332", N_("topic of channel"),
|
||||
N_("channel :topic"),
|
||||
N_("channel: name of channel\n"
|
||||
"topic: topic of the channel"),
|
||||
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 },
|
||||
{ "333", N_("infos about topic (nick & date changed)"),
|
||||
"", "",
|
||||
0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
|
||||
{ "341", N_("inviting"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
|
||||
{ "344", N_("channel reop"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_344 },
|
||||
{ "345", N_("end of channel reop list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_345 },
|
||||
{ "348", N_("channel exception list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_348 },
|
||||
{ "349", N_("end of channel exception list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_349 },
|
||||
{ "351", N_("server version"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
|
||||
{ "352", N_("who"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
|
||||
" topic: topic of the channel"),
|
||||
NULL, 2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 },
|
||||
{ "333", N_("infos about topic (nick and date changed)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
|
||||
{ "341", N_("inviting"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
|
||||
{ "344", N_("channel reop"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_344 },
|
||||
{ "345", N_("end of channel reop list"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_345 },
|
||||
{ "348", N_("channel exception list"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_348 },
|
||||
{ "349", N_("end of channel exception list"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_349 },
|
||||
{ "351", N_("server version"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
|
||||
{ "352", N_("who"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
|
||||
{ "353", N_("list of nicks on channel"),
|
||||
N_("channel :[[@|+]nick ...]"),
|
||||
N_("channel: name of channel\n"
|
||||
"nick: nick on the channel"),
|
||||
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_353 },
|
||||
{ "364", N_("links"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "365", N_("end of /links list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "366", N_("end of /names list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
|
||||
{ "367", N_("banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
|
||||
{ "368", N_("end of banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
|
||||
{ "369", N_("end of /whowas list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "371", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "372", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "373", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "374", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "375", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "376", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "381", N_("you are now an IRC operator"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "382", N_("rehashing"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "391", N_("server local time"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "401", N_("no such nick/channel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "402", N_("no such server"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "403", N_("no such channel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "404", N_("cannot send to channel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "405", N_("too many channels"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "406", N_("was no such nick"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "407", N_("was no such nick"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "409", N_("no origin"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "410", N_("no services"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "411", N_("no recipient"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "412", N_("no text to send"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "413", N_("no toplevel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "414", N_("wilcard in toplevel domain"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "421", N_("unknown command"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "422", N_("MOTD is missing"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "423", N_("no administrative info"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "424", N_("file error"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "431", N_("no nickname given"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "432", N_("erroneous nickname"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "433", N_("nickname already in use"),
|
||||
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_433 },
|
||||
{ "436", N_("nickname collision"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "438", N_("not authorized to change nickname"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_438 },
|
||||
{ "441", N_("user not in channel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "442", N_("not on channel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "443", N_("user already on channel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "444", N_("user not logged in"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "445", N_("summon has been disabled"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "446", N_("users has been disabled"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "451", N_("you are not registered"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "461", N_("not enough parameters"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "462", N_("you may not register"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "463", N_("your host isn't among the privileged"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "464", N_("password incorrect"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "465", N_("you are banned from this server"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "467", N_("channel key already set"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "470", N_("forwarding to another channel"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "471", N_("channel is already full"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "472", N_("unknown mode char to me"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "473", N_("cannot join channel (invite only)"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "474", N_("cannot join channel (banned from channel)"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "475", N_("cannot join channel (bad channel key)"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "476", N_("bad channel mask"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "477", N_("channel doesn't support modes"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "481", N_("you're not an IRC operator"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "482", N_("you're not channel operator"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "483", N_("you can't kill a server!"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "484", N_("your connection is restricted!"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "485", N_("user is immune from kick/deop"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "491", N_("no O-lines for your host"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "501", N_("unknown mode flag"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "502", N_("can't change mode for other users"),
|
||||
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "505", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "671", N_("whois (secure connection)"),
|
||||
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
|
||||
{ NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
|
||||
" nick: nick on the channel"),
|
||||
NULL, 2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_353 },
|
||||
{ "364", N_("links"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "365", N_("end of /links list"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "366", N_("end of /names list"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
|
||||
{ "367", N_("banlist"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
|
||||
{ "368", N_("end of banlist"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
|
||||
{ "369", N_("end of /whowas list"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "371", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "372", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "373", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "374", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "375", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "376", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "381", N_("you are now an IRC operator"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "382", N_("rehashing"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "391", N_("server local time"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "401", N_("no such nick/channel"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "402", N_("no such server"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "403", N_("no such channel"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "404", N_("cannot send to channel"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "405", N_("too many channels"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "406", N_("was no such nick"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "407", N_("was no such nick"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "409", N_("no origin"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "410", N_("no services"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "411", N_("no recipient"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "412", N_("no text to send"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "413", N_("no toplevel"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "414", N_("wilcard in toplevel domain"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "421", N_("unknown command"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "422", N_("MOTD is missing"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "423", N_("no administrative info"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "424", N_("file error"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "431", N_("no nickname given"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "432", N_("erroneous nickname"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "433", N_("nickname already in use"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_433 },
|
||||
{ "436", N_("nickname collision"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "438", N_("not authorized to change nickname"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_438 },
|
||||
{ "441", N_("user not in channel"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "442", N_("not on channel"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "443", N_("user already on channel"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "444", N_("user not logged in"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "445", N_("summon has been disabled"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "446", N_("users has been disabled"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "451", N_("you are not registered"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "461", N_("not enough parameters"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "462", N_("you may not register"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "463", N_("your host isn't among the privileged"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "464", N_("password incorrect"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "465", N_("you are banned from this server"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "467", N_("channel key already set"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "470", N_("forwarding to another channel"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "471", N_("channel is already full"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "472", N_("unknown mode char to me"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "473", N_("cannot join channel (invite only)"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "474", N_("cannot join channel (banned from channel)"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "475", N_("cannot join channel (bad channel key)"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "476", N_("bad channel mask"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "477", N_("channel doesn't support modes"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "481", N_("you're not an IRC operator"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "482", N_("you're not channel operator"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "483", N_("you can't kill a server!"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "484", N_("your connection is restricted!"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "485", N_("user is immune from kick/deop"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "491", N_("no O-lines for your host"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "501", N_("unknown mode flag"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "502", N_("can't change mode for other users"), "", "",
|
||||
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
|
||||
{ "505", N_("a server message"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
|
||||
{ "671", N_("whois (secure connection)"), "", "",
|
||||
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
|
||||
{ NULL, NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
+122
-22
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* irc-dcc.c: DCC communications (files & chat) */
|
||||
@@ -60,7 +60,7 @@ dcc_redraw (int highlight)
|
||||
gui_redraw_buffer (gui_get_dcc_buffer (gui_current_window));
|
||||
if (highlight)
|
||||
{
|
||||
hotlist_add (highlight, gui_get_dcc_buffer (gui_current_window));
|
||||
hotlist_add (highlight, NULL, gui_get_dcc_buffer (gui_current_window));
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 0);
|
||||
}
|
||||
}
|
||||
@@ -148,6 +148,9 @@ dcc_find_filename (t_irc_dcc *ptr_dcc)
|
||||
{
|
||||
char *ptr_home, *filename2;
|
||||
|
||||
if (!DCC_IS_FILE(ptr_dcc->type))
|
||||
return;
|
||||
|
||||
ptr_home = getenv ("HOME");
|
||||
ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) +
|
||||
strlen (ptr_dcc->nick) +
|
||||
@@ -223,20 +226,32 @@ void
|
||||
dcc_calculate_speed (t_irc_dcc *ptr_dcc, int ended)
|
||||
{
|
||||
time_t local_time, elapsed;
|
||||
unsigned long bytes_per_sec_total;
|
||||
|
||||
local_time = time (NULL);
|
||||
if (ended || local_time > ptr_dcc->last_check_time)
|
||||
{
|
||||
|
||||
if (ended)
|
||||
{
|
||||
/* calculate bytes per second (global) */
|
||||
elapsed = local_time - ptr_dcc->start_transfer;
|
||||
if (elapsed == 0)
|
||||
elapsed = 1;
|
||||
ptr_dcc->bytes_per_sec = (ptr_dcc->pos - ptr_dcc->start_resume) / elapsed;
|
||||
ptr_dcc->eta = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* calculate ETA */
|
||||
elapsed = local_time - ptr_dcc->start_transfer;
|
||||
if (elapsed == 0)
|
||||
elapsed = 1;
|
||||
bytes_per_sec_total = (ptr_dcc->pos - ptr_dcc->start_resume) / elapsed;
|
||||
if (bytes_per_sec_total == 0)
|
||||
bytes_per_sec_total = 1;
|
||||
ptr_dcc->eta = (ptr_dcc->size - ptr_dcc->pos) / bytes_per_sec_total;
|
||||
|
||||
/* calculate bytes per second (since last check time) */
|
||||
elapsed = local_time - ptr_dcc->last_check_time;
|
||||
if (elapsed == 0)
|
||||
elapsed = 1;
|
||||
@@ -605,6 +620,54 @@ dcc_start_resume (t_irc_server *server, char *filename, int port,
|
||||
WEECHAT_ERROR, filename, port, pos_start);
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_alloc: allocate a new DCC file
|
||||
*/
|
||||
|
||||
t_irc_dcc *
|
||||
dcc_alloc ()
|
||||
{
|
||||
t_irc_dcc *new_dcc;
|
||||
|
||||
/* create new DCC struct */
|
||||
if ((new_dcc = (t_irc_dcc *) malloc (sizeof (t_irc_dcc))) == NULL)
|
||||
return NULL;
|
||||
|
||||
/* default values */
|
||||
new_dcc->server = NULL;
|
||||
new_dcc->channel = NULL;
|
||||
new_dcc->type = 0;
|
||||
new_dcc->status = 0;
|
||||
new_dcc->start_time = 0;
|
||||
new_dcc->start_transfer = 0;
|
||||
new_dcc->addr = 0;
|
||||
new_dcc->port = 0;
|
||||
new_dcc->nick = NULL;
|
||||
new_dcc->sock = -1;
|
||||
new_dcc->unterminated_message = NULL;
|
||||
new_dcc->file = -1;
|
||||
new_dcc->filename = NULL;
|
||||
new_dcc->local_filename = NULL;
|
||||
new_dcc->filename_suffix = -1;
|
||||
new_dcc->size = 0;
|
||||
new_dcc->pos = 0;
|
||||
new_dcc->ack = 0;
|
||||
new_dcc->start_resume = 0;
|
||||
new_dcc->last_check_time = 0;
|
||||
new_dcc->last_check_pos = 0;
|
||||
new_dcc->last_activity = 0;
|
||||
new_dcc->bytes_per_sec = 0;
|
||||
new_dcc->eta = 0;
|
||||
|
||||
new_dcc->prev_dcc = NULL;
|
||||
new_dcc->next_dcc = dcc_list;
|
||||
if (dcc_list)
|
||||
dcc_list->prev_dcc = new_dcc;
|
||||
dcc_list = new_dcc;
|
||||
|
||||
return new_dcc;
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_add: add a DCC file to queue
|
||||
*/
|
||||
@@ -615,8 +678,8 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
{
|
||||
t_irc_dcc *new_dcc;
|
||||
|
||||
/* create new DCC struct */
|
||||
if ((new_dcc = (t_irc_dcc *) malloc (sizeof (t_irc_dcc))) == NULL)
|
||||
new_dcc = dcc_alloc ();
|
||||
if (!new_dcc)
|
||||
{
|
||||
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
|
||||
gui_printf (server->buffer,
|
||||
@@ -650,17 +713,13 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic
|
||||
new_dcc->start_resume = 0;
|
||||
new_dcc->last_check_time = time (NULL);
|
||||
new_dcc->last_check_pos = 0;
|
||||
new_dcc->bytes_per_sec = 0;
|
||||
new_dcc->last_activity = time (NULL);
|
||||
new_dcc->bytes_per_sec = 0;
|
||||
new_dcc->eta = 0;
|
||||
if (local_filename)
|
||||
new_dcc->local_filename = strdup (local_filename);
|
||||
else
|
||||
dcc_find_filename (new_dcc);
|
||||
new_dcc->prev_dcc = NULL;
|
||||
new_dcc->next_dcc = dcc_list;
|
||||
if (dcc_list)
|
||||
dcc_list->prev_dcc = new_dcc;
|
||||
dcc_list = new_dcc;
|
||||
|
||||
gui_current_window->dcc_first = NULL;
|
||||
gui_current_window->dcc_selected = NULL;
|
||||
@@ -1061,10 +1120,9 @@ dcc_chat_sendf (t_irc_dcc *ptr_dcc, char *fmt, ...)
|
||||
gui_printf (ptr_dcc->server->buffer, "[DEBUG] Sending to remote host (DCC CHAT) >>> %s\n", buffer);
|
||||
buffer[size_buf - 2] = '\r';
|
||||
#endif
|
||||
buf2 = weechat_convert_encoding ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
cfg_look_charset_encode,
|
||||
buffer);
|
||||
buf2 = channel_iconv_encode (ptr_dcc->server,
|
||||
ptr_dcc->channel,
|
||||
buffer);
|
||||
if (dcc_chat_send (ptr_dcc, buf2, strlen (buf2)) <= 0)
|
||||
{
|
||||
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
|
||||
@@ -1085,7 +1143,7 @@ void
|
||||
dcc_chat_recv (t_irc_dcc *ptr_dcc)
|
||||
{
|
||||
static char buffer[4096 + 2];
|
||||
char *buf2, *pos, *ptr_buf, *next_ptr_buf;
|
||||
char *buf2, *pos, *ptr_buf, *ptr_buf2, *next_ptr_buf;
|
||||
char *ptr_buf_color;
|
||||
int num_read;
|
||||
|
||||
@@ -1137,7 +1195,11 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
|
||||
|
||||
if (ptr_buf)
|
||||
{
|
||||
ptr_buf_color = (char *)gui_color_decode ((unsigned char *)ptr_buf,
|
||||
ptr_buf2 = channel_iconv_decode (ptr_dcc->server,
|
||||
ptr_dcc->channel,
|
||||
ptr_buf);
|
||||
ptr_buf_color = (char *)gui_color_decode ((ptr_buf2) ?
|
||||
(unsigned char *)ptr_buf2 : (unsigned char *)ptr_buf,
|
||||
cfg_irc_colors_receive);
|
||||
gui_printf_type (ptr_dcc->channel->buffer, MSG_TYPE_NICK,
|
||||
"%s<", GUI_COLOR(COLOR_WIN_CHAT_DARK));
|
||||
@@ -1154,7 +1216,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
|
||||
COLOR_WIN_INFOBAR_HIGHLIGHT,
|
||||
_("Private %s> %s"),
|
||||
ptr_dcc->nick,
|
||||
(ptr_buf_color) ? ptr_buf_color : ptr_buf);
|
||||
(ptr_buf_color) ? ptr_buf_color : ((ptr_buf2) ? ptr_buf2 : ptr_buf));
|
||||
}
|
||||
else
|
||||
gui_printf_type (ptr_dcc->channel->buffer, MSG_TYPE_NICK,
|
||||
@@ -1169,13 +1231,15 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc)
|
||||
(ptr_buf_color) ? ptr_buf_color : ptr_buf);
|
||||
if (ptr_buf_color)
|
||||
free (ptr_buf_color);
|
||||
if (ptr_buf2)
|
||||
free (ptr_buf2);
|
||||
}
|
||||
|
||||
ptr_buf = next_ptr_buf;
|
||||
}
|
||||
|
||||
if (buf2)
|
||||
free (buf2);
|
||||
free (buf2);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1424,9 +1488,45 @@ dcc_end ()
|
||||
if (ptr_dcc->sock != -1)
|
||||
{
|
||||
if (ptr_dcc->status == DCC_ACTIVE)
|
||||
wee_log_printf (_("Aborting active DCC: \"%s\" from %s\n"),
|
||||
ptr_dcc->filename, ptr_dcc->nick);
|
||||
weechat_log_printf (_("Aborting active DCC: \"%s\" from %s\n"),
|
||||
ptr_dcc->filename, ptr_dcc->nick);
|
||||
dcc_close (ptr_dcc, DCC_FAILED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* dcc_print_log: print DCC infos in log (usually for crash dump)
|
||||
*/
|
||||
|
||||
void
|
||||
dcc_print_log (t_irc_dcc *dcc)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
+67
-31
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* irc-display.c: display functions for IRC */
|
||||
@@ -94,22 +94,22 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
|
||||
if (display_around)
|
||||
gui_printf_type (buffer, type, "%s%s",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
(nick) ? "<" : ">");
|
||||
(nick || BUFFER_IS_PRIVATE(buffer)) ? "<" : ">");
|
||||
if (nick && cfg_look_nickmode)
|
||||
{
|
||||
if (nick->is_chanowner)
|
||||
if (nick->flags & NICK_CHANOWNER)
|
||||
gui_printf_type (buffer, type, "%s~",
|
||||
GUI_COLOR(COLOR_WIN_NICK_OP));
|
||||
else if (nick->is_chanadmin)
|
||||
else if (nick->flags & NICK_CHANADMIN)
|
||||
gui_printf_type (buffer, type, "%s&",
|
||||
GUI_COLOR(COLOR_WIN_NICK_OP));
|
||||
else if (nick->is_op)
|
||||
else if (nick->flags & NICK_OP)
|
||||
gui_printf_type (buffer, type, "%s@",
|
||||
GUI_COLOR(COLOR_WIN_NICK_OP));
|
||||
else if (nick->is_halfop)
|
||||
else if (nick->flags & NICK_HALFOP)
|
||||
gui_printf_type (buffer, type, "%s%%",
|
||||
GUI_COLOR(COLOR_WIN_NICK_HALFOP));
|
||||
else if (nick->has_voice)
|
||||
else if (nick->flags & NICK_VOICE)
|
||||
gui_printf_type (buffer, type, "%s+",
|
||||
GUI_COLOR(COLOR_WIN_NICK_VOICE));
|
||||
else
|
||||
@@ -124,18 +124,43 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
|
||||
else
|
||||
gui_printf_type (buffer, type, "%s%s",
|
||||
GUI_COLOR((nick && color_nick) ?
|
||||
((cfg_look_color_nicks) ?
|
||||
nick->color : COLOR_WIN_CHAT) :
|
||||
COLOR_WIN_CHAT),
|
||||
nick->color : COLOR_WIN_CHAT),
|
||||
(nick) ? nick->nick : nickname);
|
||||
|
||||
if (display_around)
|
||||
gui_printf_type (buffer, type, "%s%s",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
(nick) ? "> " : "< ");
|
||||
(nick || BUFFER_IS_PRIVATE(buffer)) ? "> " : "< ");
|
||||
gui_printf_type (buffer, type, GUI_NO_COLOR);
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_display_away: display away on all channels of all servers
|
||||
*/
|
||||
|
||||
void
|
||||
irc_display_away (t_irc_server *server, char *string1, char *string2)
|
||||
{
|
||||
t_irc_channel *ptr_channel;
|
||||
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
gui_printf_nolog (ptr_channel->buffer,
|
||||
"%s[%s%s%s %s: %s%s]\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_NICK),
|
||||
server->nick,
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
string1,
|
||||
string2,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_display_mode: display IRC message for mode change
|
||||
*/
|
||||
@@ -164,7 +189,7 @@ irc_display_mode (t_irc_server *server, t_gui_buffer *buffer,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_NICK),
|
||||
param);
|
||||
else
|
||||
gui_printf (buffer, " %s\n",
|
||||
gui_printf (buffer, " %s%s\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
message);
|
||||
}
|
||||
@@ -179,7 +204,7 @@ irc_display_server (t_irc_server *server)
|
||||
gui_printf (NULL, "\n");
|
||||
gui_printf (NULL, _("%sServer: %s%s %s[%s%s%s]\n"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
|
||||
server->name,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
@@ -187,26 +212,27 @@ irc_display_server (t_irc_server *server)
|
||||
_("connected") : _("not connected"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK));
|
||||
|
||||
gui_printf (NULL, " server_autoconnect . . . .: %s%s\n",
|
||||
gui_printf (NULL, " server_autoconnect . . . . : %s%s\n",
|
||||
(server->autoconnect) ? _("on") : _("off"),
|
||||
(server->command_line) ?
|
||||
_(" (temporary server, will not be saved)") : "");
|
||||
gui_printf (NULL, " server_autoreconnect . . .: %s\n",
|
||||
gui_printf (NULL, " server_autoreconnect . . . : %s\n",
|
||||
(server->autoreconnect) ? _("on") : _("off"));
|
||||
gui_printf (NULL, " server_autoreconnect_delay: %d seconds\n",
|
||||
server->autoreconnect_delay);
|
||||
gui_printf (NULL, " server_address . . . . . .: %s\n",
|
||||
gui_printf (NULL, " server_autoreconnect_delay : %d %s\n",
|
||||
server->autoreconnect_delay,
|
||||
_("seconds"));
|
||||
gui_printf (NULL, " server_address . . . . . . : %s\n",
|
||||
server->address);
|
||||
gui_printf (NULL, " server_port . . . . . . .: %d\n",
|
||||
gui_printf (NULL, " server_port . . . . . . . : %d\n",
|
||||
server->port);
|
||||
gui_printf (NULL, " server_ipv6 . . . . . . .: %s\n",
|
||||
gui_printf (NULL, " server_ipv6 . . . . . . . : %s\n",
|
||||
(server->ipv6) ? _("on") : _("off"));
|
||||
gui_printf (NULL, " server_ssl . . . . . . . .: %s\n",
|
||||
gui_printf (NULL, " server_ssl . . . . . . . . : %s\n",
|
||||
(server->ssl) ? _("on") : _("off"));
|
||||
gui_printf (NULL, " server_password . . . . .: %s\n",
|
||||
gui_printf (NULL, " server_password . . . . . : %s\n",
|
||||
(server->password && server->password[0]) ?
|
||||
_("(hidden)") : "");
|
||||
gui_printf (NULL, " server_nick1/2/3 . . . . .: %s %s/ %s%s %s/ %s%s\n",
|
||||
gui_printf (NULL, " server_nick1/2/3 . . . . . : %s %s/ %s%s %s/ %s%s\n",
|
||||
server->nick1,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
@@ -214,19 +240,29 @@ irc_display_server (t_irc_server *server)
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
server->nick3);
|
||||
gui_printf (NULL, " server_username . . . . .: %s\n",
|
||||
gui_printf (NULL, " server_username . . . . . : %s\n",
|
||||
server->username);
|
||||
gui_printf (NULL, " server_realname . . . . .: %s\n",
|
||||
gui_printf (NULL, " server_realname . . . . . : %s\n",
|
||||
server->realname);
|
||||
gui_printf (NULL, " server_command . . . . . .: %s\n",
|
||||
gui_printf (NULL, " server_command . . . . . . : %s\n",
|
||||
(server->command && server->command[0]) ?
|
||||
server->command : "");
|
||||
gui_printf (NULL, " server_command_delay . . .: %d seconds\n",
|
||||
server->command_delay);
|
||||
gui_printf (NULL, " server_autojoin . . . . .: %s\n",
|
||||
gui_printf (NULL, " server_command_delay . . . : %d %s\n",
|
||||
server->command_delay,
|
||||
_("seconds"));
|
||||
gui_printf (NULL, " server_autojoin . . . . . : %s\n",
|
||||
(server->autojoin && server->autojoin[0]) ?
|
||||
server->autojoin : "");
|
||||
gui_printf (NULL, " server_notify_levels . . .: %s\n",
|
||||
gui_printf (NULL, " server_notify_levels . . . : %s\n",
|
||||
(server->notify_levels && server->notify_levels[0]) ?
|
||||
server->notify_levels : "");
|
||||
gui_printf (NULL, " server_charset_decode_iso. : %s\n",
|
||||
(server->charset_decode_iso && server->charset_decode_iso[0]) ?
|
||||
server->charset_decode_iso : "");
|
||||
gui_printf (NULL, " server_charset_decode_utf. : %s\n",
|
||||
(server->charset_decode_utf && server->charset_decode_utf[0]) ?
|
||||
server->charset_decode_utf : "");
|
||||
gui_printf (NULL, " server_charset_encode. . . : %s\n",
|
||||
(server->charset_encode && server->charset_encode[0]) ?
|
||||
server->charset_encode : "");
|
||||
}
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* irc-ignore.c: manages IRC ignore list */
|
||||
@@ -459,18 +459,18 @@ ignore_print_log ()
|
||||
{
|
||||
t_irc_ignore *ptr_ignore;
|
||||
|
||||
wee_log_printf ("[ignore list]\n");
|
||||
weechat_log_printf ("[ignore list]\n");
|
||||
|
||||
for (ptr_ignore = irc_ignore; ptr_ignore;
|
||||
ptr_ignore = ptr_ignore->next_ignore)
|
||||
{
|
||||
wee_log_printf ("\n");
|
||||
wee_log_printf (" -> ignore at 0x%X:\n", ptr_ignore);
|
||||
wee_log_printf (" mask. . . . . . . : %s\n", ptr_ignore->mask);
|
||||
wee_log_printf (" type. . . . . . . : %s\n", ptr_ignore->type);
|
||||
wee_log_printf (" channel_name. . . : %s\n", ptr_ignore->channel_name);
|
||||
wee_log_printf (" server_name . . . : %s\n", ptr_ignore->server_name);
|
||||
wee_log_printf (" prev_ignore . . . : 0x%X\n", ptr_ignore->prev_ignore);
|
||||
wee_log_printf (" next_ignore . . . : 0x%X\n", ptr_ignore->next_ignore);
|
||||
weechat_log_printf ("\n");
|
||||
weechat_log_printf (" -> ignore at 0x%X:\n", ptr_ignore);
|
||||
weechat_log_printf (" mask. . . . . . . : %s\n", ptr_ignore->mask);
|
||||
weechat_log_printf (" type. . . . . . . : %s\n", ptr_ignore->type);
|
||||
weechat_log_printf (" channel_name. . . : %s\n", ptr_ignore->channel_name);
|
||||
weechat_log_printf (" server_name . . . : %s\n", ptr_ignore->server_name);
|
||||
weechat_log_printf (" prev_ignore . . . : 0x%X\n", ptr_ignore->prev_ignore);
|
||||
weechat_log_printf (" next_ignore . . . : 0x%X\n", ptr_ignore->next_ignore);
|
||||
}
|
||||
}
|
||||
|
||||
+35
-41
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* irc-nick.c: manages nick list for channels */
|
||||
@@ -59,15 +59,15 @@ nick_find_color (t_irc_nick *nick)
|
||||
int
|
||||
nick_score_for_sort (t_irc_nick *nick)
|
||||
{
|
||||
if (nick->is_chanowner)
|
||||
if (nick->flags & NICK_CHANOWNER)
|
||||
return -32;
|
||||
if (nick->is_chanadmin)
|
||||
if (nick->flags & NICK_CHANADMIN)
|
||||
return -16;
|
||||
if (nick->is_op)
|
||||
if (nick->flags & NICK_OP)
|
||||
return -8;
|
||||
if (nick->is_halfop)
|
||||
if (nick->flags & NICK_HALFOP)
|
||||
return -4;
|
||||
if (nick->has_voice)
|
||||
if (nick->flags & NICK_VOICE)
|
||||
return -2;
|
||||
return 0;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ nick_insert_sorted (t_irc_channel *channel, t_irc_nick *nick)
|
||||
*/
|
||||
|
||||
t_irc_nick *
|
||||
nick_new (t_irc_channel *channel, char *nick_name,
|
||||
nick_new (t_irc_server *server, t_irc_channel *channel, char *nick_name,
|
||||
int is_chanowner, int is_chanadmin, int is_op, int is_halfop,
|
||||
int has_voice)
|
||||
{
|
||||
@@ -178,35 +178,31 @@ nick_new (t_irc_channel *channel, char *nick_name,
|
||||
if ((new_nick = nick_search (channel, nick_name)))
|
||||
{
|
||||
/* update nick */
|
||||
new_nick->is_chanowner = is_chanowner;
|
||||
new_nick->is_chanadmin = is_chanadmin;
|
||||
new_nick->is_op = is_op;
|
||||
new_nick->is_halfop = is_halfop;
|
||||
new_nick->has_voice = has_voice;
|
||||
NICK_SET_FLAG(new_nick, is_chanowner, NICK_CHANOWNER);
|
||||
NICK_SET_FLAG(new_nick, is_chanadmin, NICK_CHANADMIN);
|
||||
NICK_SET_FLAG(new_nick, is_op, NICK_OP);
|
||||
NICK_SET_FLAG(new_nick, is_halfop, NICK_HALFOP);
|
||||
NICK_SET_FLAG(new_nick, has_voice, NICK_VOICE);
|
||||
return new_nick;
|
||||
}
|
||||
|
||||
/* alloc memory for new nick */
|
||||
if ((new_nick = (t_irc_nick *) malloc (sizeof (t_irc_nick))) == NULL)
|
||||
{
|
||||
gui_printf (channel->buffer,
|
||||
_("%s cannot allocate new nick\n"), WEECHAT_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* initialize new nick */
|
||||
new_nick->nick = strdup (nick_name);
|
||||
new_nick->is_chanowner = is_chanowner;
|
||||
new_nick->is_chanadmin = is_chanadmin;
|
||||
new_nick->is_op = is_op;
|
||||
new_nick->is_halfop = is_halfop;
|
||||
new_nick->has_voice = has_voice;
|
||||
new_nick->is_away = 0;
|
||||
if (ascii_strcasecmp (new_nick->nick, SERVER(channel->buffer)->nick) == 0)
|
||||
new_nick->flags = 0;
|
||||
NICK_SET_FLAG(new_nick, is_chanowner, NICK_CHANOWNER);
|
||||
NICK_SET_FLAG(new_nick, is_chanadmin, NICK_CHANADMIN);
|
||||
NICK_SET_FLAG(new_nick, is_op, NICK_OP);
|
||||
NICK_SET_FLAG(new_nick, is_halfop, NICK_HALFOP);
|
||||
NICK_SET_FLAG(new_nick, has_voice, NICK_VOICE);
|
||||
if (ascii_strcasecmp (new_nick->nick, server->nick) == 0)
|
||||
new_nick->color = COLOR_WIN_NICK_SELF;
|
||||
else
|
||||
new_nick->color = nick_find_color (new_nick);
|
||||
|
||||
|
||||
nick_insert_sorted (channel, new_nick);
|
||||
|
||||
channel->nicks_count++;
|
||||
@@ -347,15 +343,17 @@ nick_count (t_irc_channel *channel, int *total, int *count_op,
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
(*total)++;
|
||||
if ((ptr_nick->is_chanowner) || (ptr_nick->is_chanadmin) || (ptr_nick->is_op))
|
||||
if ((ptr_nick->flags & NICK_CHANOWNER) ||
|
||||
(ptr_nick->flags & NICK_CHANADMIN) ||
|
||||
(ptr_nick->flags & NICK_OP))
|
||||
(*count_op)++;
|
||||
else
|
||||
{
|
||||
if (ptr_nick->is_halfop)
|
||||
if (ptr_nick->flags & NICK_HALFOP)
|
||||
(*count_halfop)++;
|
||||
else
|
||||
{
|
||||
if (ptr_nick->has_voice)
|
||||
if (ptr_nick->flags & NICK_VOICE)
|
||||
(*count_voice)++;
|
||||
else
|
||||
(*count_normal)++;
|
||||
@@ -391,9 +389,10 @@ nick_get_max_length (t_irc_channel *channel)
|
||||
void
|
||||
nick_set_away (t_irc_channel *channel, t_irc_nick *nick, int is_away)
|
||||
{
|
||||
if (nick->is_away != is_away)
|
||||
if (((is_away) && (!(nick->flags & NICK_AWAY))) ||
|
||||
((!is_away) && (nick->flags & NICK_AWAY)))
|
||||
{
|
||||
nick->is_away = is_away;
|
||||
NICK_SET_FLAG(nick, is_away, NICK_AWAY);
|
||||
gui_draw_buffer_nick (channel->buffer, 0);
|
||||
}
|
||||
}
|
||||
@@ -405,14 +404,9 @@ nick_set_away (t_irc_channel *channel, t_irc_nick *nick, int is_away)
|
||||
void
|
||||
nick_print_log (t_irc_nick *nick)
|
||||
{
|
||||
wee_log_printf ("=> nick %s (addr:0x%X)]\n", nick->nick, nick);
|
||||
wee_log_printf (" is_chanowner . : %d\n", nick->is_chanowner);
|
||||
wee_log_printf (" is_chanadmin . : %d\n", nick->is_chanadmin);
|
||||
wee_log_printf (" is_op. . . . . : %d\n", nick->is_op);
|
||||
wee_log_printf (" is_halfop. . . : %d\n", nick->is_halfop);
|
||||
wee_log_printf (" has_voice. . . : %d\n", nick->has_voice);
|
||||
wee_log_printf (" is_away. . . . : %d\n", nick->is_away);
|
||||
wee_log_printf (" color. . . . . : %d\n", nick->color);
|
||||
wee_log_printf (" prev_nick. . . : 0x%X\n", nick->prev_nick);
|
||||
wee_log_printf (" next_nick. . . : 0x%X\n", nick->next_nick);
|
||||
weechat_log_printf ("=> nick %s (addr:0x%X)]\n", nick->nick, nick);
|
||||
weechat_log_printf (" flags. . . . . : %d\n", nick->flags);
|
||||
weechat_log_printf (" color. . . . . : %d\n", nick->color);
|
||||
weechat_log_printf (" prev_nick. . . : 0x%X\n", nick->prev_nick);
|
||||
weechat_log_printf (" next_nick. . . : 0x%X\n", nick->next_nick);
|
||||
}
|
||||
|
||||
+70
-39
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* irc-recv.c: implementation of IRC commands (server to client),
|
||||
@@ -365,7 +365,7 @@ irc_cmd_recv_invite (t_irc_server *server, char *host, char *nick, char *argumen
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_NICK),
|
||||
nick);
|
||||
hotlist_add (HOTLIST_HIGHLIGHT, server->buffer);
|
||||
hotlist_add (HOTLIST_HIGHLIGHT, server, server->buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
@@ -396,7 +396,7 @@ irc_cmd_recv_join (t_irc_server *server, char *host, char *nick, char *arguments
|
||||
ptr_channel = channel_search (server, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
ptr_channel = channel_new (server, CHAT_CHANNEL, arguments, 1);
|
||||
ptr_channel = channel_new (server, CHANNEL_TYPE_CHANNEL, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
|
||||
@@ -405,6 +405,7 @@ irc_cmd_recv_join (t_irc_server *server, char *host, char *nick, char *arguments
|
||||
WEECHAT_ERROR, arguments);
|
||||
return -1;
|
||||
}
|
||||
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 1);
|
||||
}
|
||||
|
||||
if (!command_ignored)
|
||||
@@ -423,7 +424,7 @@ irc_cmd_recv_join (t_irc_server *server, char *host, char *nick, char *arguments
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
arguments);
|
||||
}
|
||||
(void) nick_new (ptr_channel, nick, 0, 0, 0, 0, 0);
|
||||
(void) nick_new (server, ptr_channel, nick, 0, 0, 0, 0, 0);
|
||||
gui_draw_buffer_nick (ptr_channel->buffer, 1);
|
||||
gui_draw_buffer_status (ptr_channel->buffer, 1);
|
||||
return 0;
|
||||
@@ -705,7 +706,7 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
ptr_nick = nick_search (ptr_channel, parm);
|
||||
if (ptr_nick)
|
||||
{
|
||||
ptr_nick->is_halfop = (set_flag == '+') ? 1 : 0;
|
||||
NICK_SET_FLAG(ptr_nick, (set_flag == '+'), NICK_HALFOP);
|
||||
nick_resort (ptr_channel, ptr_nick);
|
||||
gui_draw_buffer_nick (ptr_channel->buffer, 1);
|
||||
}
|
||||
@@ -728,8 +729,8 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
_("sets invite-only channel flag") :
|
||||
_("removes invite-only channel flag"),
|
||||
NULL);
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_INVITE);
|
||||
CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_INVITE);
|
||||
break;
|
||||
case 'k':
|
||||
pos = NULL;
|
||||
@@ -748,8 +749,8 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
(set_flag == '+') ?
|
||||
((parm) ? parm : NULL) :
|
||||
NULL);
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_KEY);
|
||||
CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_KEY);
|
||||
if (ptr_channel->key)
|
||||
free (ptr_channel->key);
|
||||
ptr_channel->key = strdup (parm);
|
||||
@@ -780,8 +781,8 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
(set_flag == '+') ?
|
||||
((parm) ? parm : NULL) :
|
||||
NULL);
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_LIMIT);
|
||||
CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_LIMIT);
|
||||
ptr_channel->limit = atoi (parm);
|
||||
|
||||
/* look for next parameter */
|
||||
@@ -801,8 +802,8 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
_("sets moderated channel flag") :
|
||||
_("removes moderated channel flag"),
|
||||
NULL);
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_MODERATED);
|
||||
CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_MODERATED);
|
||||
break;
|
||||
case 'n':
|
||||
if (nick_host)
|
||||
@@ -812,8 +813,8 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
_("sets messages from channel only flag") :
|
||||
_("removes messages from channel only flag"),
|
||||
NULL);
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_NO_MSG_OUT);
|
||||
CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_NO_MSG_OUT);
|
||||
break;
|
||||
case 'o':
|
||||
pos = NULL;
|
||||
@@ -835,7 +836,7 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
ptr_nick = nick_search (ptr_channel, parm);
|
||||
if (ptr_nick)
|
||||
{
|
||||
ptr_nick->is_op = (set_flag == '+') ? 1 : 0;
|
||||
NICK_SET_FLAG(ptr_nick, (set_flag == '+'), NICK_OP);
|
||||
nick_resort (ptr_channel, ptr_nick);
|
||||
gui_draw_buffer_nick (ptr_channel->buffer, 1);
|
||||
}
|
||||
@@ -858,8 +859,8 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
_("sets private channel flag") :
|
||||
_("removes private channel flag"),
|
||||
NULL);
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_SECRET);
|
||||
CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_SECRET);
|
||||
break;
|
||||
case 'q':
|
||||
pos = NULL;
|
||||
@@ -894,8 +895,8 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
_("sets secret channel flag") :
|
||||
_("removes secret channel flag"),
|
||||
NULL);
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_SECRET);
|
||||
CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_SECRET);
|
||||
break;
|
||||
case 't':
|
||||
if (nick_host)
|
||||
@@ -905,8 +906,8 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
_("sets topic protection") :
|
||||
_("removes topic protection"),
|
||||
NULL);
|
||||
SET_CHANNEL_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_TOPIC);
|
||||
CHANNEL_SET_MODE(ptr_channel, (set_flag == '+'),
|
||||
CHANNEL_MODE_TOPIC);
|
||||
break;
|
||||
case 'v':
|
||||
pos = NULL;
|
||||
@@ -929,7 +930,7 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *ptr_channel,
|
||||
ptr_nick = nick_search (ptr_channel, parm);
|
||||
if (ptr_nick)
|
||||
{
|
||||
ptr_nick->has_voice = (set_flag == '+') ? 1 : 0;
|
||||
NICK_SET_FLAG(ptr_nick, (set_flag == '+'), NICK_VOICE);
|
||||
nick_resort (ptr_channel, ptr_nick);
|
||||
gui_draw_buffer_nick (ptr_channel->buffer, 1);
|
||||
}
|
||||
@@ -1222,7 +1223,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
|
||||
ptr_channel = channel_search (server, nick);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
ptr_channel = channel_new (server, CHAT_PRIVATE, nick, 0);
|
||||
ptr_channel = channel_new (server, CHANNEL_TYPE_PRIVATE, nick);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
|
||||
@@ -1231,6 +1232,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
|
||||
WEECHAT_ERROR, nick);
|
||||
return -1;
|
||||
}
|
||||
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 0);
|
||||
}
|
||||
if (!ptr_channel->topic)
|
||||
ptr_channel->topic = strdup ((host2) ? host2 : "");
|
||||
@@ -1288,7 +1290,7 @@ irc_cmd_recv_notice (t_irc_server *server, char *host, char *nick, char *argumen
|
||||
(ascii_strcasecmp (nick, "chanserv") != 0) &&
|
||||
(ascii_strcasecmp (nick, "memoserv") != 0))
|
||||
{
|
||||
hotlist_add (HOTLIST_PRIVATE, server->buffer);
|
||||
hotlist_add (HOTLIST_PRIVATE, server, server->buffer);
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
@@ -2034,7 +2036,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
|
||||
{
|
||||
if (!ptr_channel)
|
||||
{
|
||||
ptr_channel = channel_new (server, CHAT_PRIVATE, nick, 0);
|
||||
ptr_channel = channel_new (server, CHANNEL_TYPE_PRIVATE, nick);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
|
||||
@@ -2043,6 +2045,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
|
||||
WEECHAT_ERROR, nick);
|
||||
return -1;
|
||||
}
|
||||
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 0);
|
||||
}
|
||||
if (!ptr_channel->topic)
|
||||
ptr_channel->topic = strdup (host2);
|
||||
@@ -2124,7 +2127,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
|
||||
{
|
||||
if (!ptr_channel)
|
||||
{
|
||||
ptr_channel = channel_new (server, CHAT_PRIVATE, nick, 0);
|
||||
ptr_channel = channel_new (server, CHANNEL_TYPE_PRIVATE, nick);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
|
||||
@@ -2133,6 +2136,7 @@ irc_cmd_recv_privmsg (t_irc_server *server, char *host, char *nick, char *argume
|
||||
WEECHAT_ERROR, nick);
|
||||
return -1;
|
||||
}
|
||||
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 0);
|
||||
}
|
||||
if (!ptr_channel->topic)
|
||||
ptr_channel->topic = strdup (host2);
|
||||
@@ -2206,7 +2210,7 @@ irc_cmd_recv_quit (t_irc_server *server, char *host, char *nick, char *arguments
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_PRIVATE)
|
||||
if (ptr_channel->type == CHANNEL_TYPE_PRIVATE)
|
||||
ptr_nick = NULL;
|
||||
else
|
||||
ptr_nick = nick_search (ptr_channel, nick);
|
||||
@@ -2221,14 +2225,16 @@ irc_cmd_recv_quit (t_irc_server *server, char *host, char *nick, char *arguments
|
||||
pos = strchr (host, '!');
|
||||
irc_display_prefix (server, ptr_channel->buffer, PREFIX_QUIT);
|
||||
gui_printf (ptr_channel->buffer,
|
||||
_("%s%s %s(%s%s%s)%s has quit %s(%s%s%s)\n"),
|
||||
_("%s%s %s(%s%s%s)%s has quit"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_NICK),
|
||||
nick,
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_HOST),
|
||||
(pos) ? pos + 1 : "",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
gui_printf (ptr_channel->buffer,
|
||||
" %s(%s%s%s)\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_DARK),
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
arguments,
|
||||
@@ -2443,7 +2449,7 @@ irc_cmd_recv_004 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
/* execute command once connected */
|
||||
if (server->command && server->command[0])
|
||||
{
|
||||
user_command(server, NULL, server->command);
|
||||
user_command(NULL, server, server->command);
|
||||
if (server->command_delay > 0)
|
||||
sleep (server->command_delay);
|
||||
}
|
||||
@@ -2454,7 +2460,7 @@ irc_cmd_recv_004 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
if (ptr_channel->key)
|
||||
server_sendf (server, "JOIN %s %s\r\n",
|
||||
@@ -2531,6 +2537,8 @@ int
|
||||
irc_cmd_recv_301 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
char *pos_nick, *pos_message;
|
||||
t_irc_channel *ptr_channel;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) server;
|
||||
@@ -2554,8 +2562,11 @@ irc_cmd_recv_301 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
|
||||
if (!command_ignored)
|
||||
{
|
||||
irc_display_prefix (server, gui_current_window->buffer, PREFIX_INFO);
|
||||
gui_printf (gui_current_window->buffer,
|
||||
/* look for private buffer to display message */
|
||||
ptr_channel = channel_search (server, pos_nick);
|
||||
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
|
||||
irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
|
||||
gui_printf (ptr_buffer,
|
||||
_("%s%s%s is away: %s\n"),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_NICK),
|
||||
pos_nick,
|
||||
@@ -2680,6 +2691,8 @@ irc_cmd_recv_303 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_cmd_recv_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
(void) nick;
|
||||
@@ -2699,6 +2712,12 @@ irc_cmd_recv_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 0;
|
||||
server->away_time = 0;
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_draw_buffer_status (ptr_window->buffer, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2709,6 +2728,8 @@ irc_cmd_recv_305 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
int
|
||||
irc_cmd_recv_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
{
|
||||
t_gui_window *ptr_window;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) host;
|
||||
(void) nick;
|
||||
@@ -2728,6 +2749,15 @@ irc_cmd_recv_306 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
}
|
||||
server->is_away = 1;
|
||||
server->away_time = time (NULL);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
gui_draw_buffer_status (ptr_window->buffer, 1);
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3587,10 +3617,11 @@ irc_cmd_recv_332 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
if (!command_ignored)
|
||||
{
|
||||
irc_display_prefix (server, ptr_channel->buffer, PREFIX_INFO);
|
||||
gui_printf (ptr_channel->buffer, _("Topic for %s%s%s is: \"%s\"\n"),
|
||||
gui_printf (ptr_channel->buffer, _("Topic for %s%s%s is: "),
|
||||
GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
|
||||
pos,
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
GUI_COLOR(COLOR_WIN_CHAT));
|
||||
gui_printf (ptr_channel->buffer, "\"%s\"\n",
|
||||
pos2);
|
||||
}
|
||||
|
||||
@@ -4290,8 +4321,8 @@ irc_cmd_recv_353 (t_irc_server *server, char *host, char *nick, char *arguments)
|
||||
pos[0] = '\0';
|
||||
pos++;
|
||||
}
|
||||
if (!nick_new (ptr_channel, pos_nick, is_chanowner, is_chanadmin,
|
||||
is_op, is_halfop, has_voice))
|
||||
if (!nick_new (server, ptr_channel, pos_nick, is_chanowner,
|
||||
is_chanadmin, is_op, is_halfop, has_voice))
|
||||
{
|
||||
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
|
||||
+177
-171
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* irc-send.c: implementation of IRC commands (client to server),
|
||||
@@ -61,6 +61,8 @@ irc_login (t_irc_server *server)
|
||||
gui_printf (server->buffer,
|
||||
_("%s: using local hostname \"%s\"\n"),
|
||||
PACKAGE_NAME, hostname);
|
||||
if (!server->nick)
|
||||
server->nick = strdup (server->nick1);
|
||||
server_sendf (server,
|
||||
"NICK %s\r\n"
|
||||
"USER %s %s %s :%s\r\n",
|
||||
@@ -82,6 +84,31 @@ irc_cmd_send_admin (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_send_me: send a ctcp action to a channel
|
||||
*/
|
||||
|
||||
int
|
||||
irc_send_me (t_irc_server *server, t_irc_channel *channel, char *arguments)
|
||||
{
|
||||
char *string;
|
||||
|
||||
server_sendf (server, "PRIVMSG %s :\01ACTION %s\01\r\n",
|
||||
channel->name,
|
||||
(arguments && arguments[0]) ? arguments : "");
|
||||
irc_display_prefix (NULL, channel->buffer, PREFIX_ACTION_ME);
|
||||
string = (arguments && arguments[0]) ?
|
||||
(char *)gui_color_decode ((unsigned char *)arguments, 1) : NULL;
|
||||
gui_printf (channel->buffer, "%s%s %s%s\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_NICK),
|
||||
server->nick,
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
(string) ? string : "");
|
||||
if (string)
|
||||
free (string);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_ame: send a ctcp action to all channels of all connected servers
|
||||
*/
|
||||
@@ -91,7 +118,6 @@ irc_cmd_send_ame (t_irc_server *server, char *arguments)
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
t_irc_channel *ptr_channel;
|
||||
char *string;
|
||||
|
||||
/* make gcc happy */
|
||||
(void) server;
|
||||
@@ -105,22 +131,8 @@ irc_cmd_send_ame (t_irc_server *server, char *arguments)
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
{
|
||||
server_sendf (ptr_server, "PRIVMSG %s :\01ACTION %s\01\r\n",
|
||||
ptr_channel->name,
|
||||
(arguments && arguments[0]) ? arguments : "");
|
||||
irc_display_prefix (NULL, ptr_channel->buffer, PREFIX_ACTION_ME);
|
||||
string = (arguments && arguments[0]) ?
|
||||
(char *)gui_color_decode ((unsigned char *)arguments, 1) : NULL;
|
||||
gui_printf (ptr_channel->buffer, "%s%s %s%s\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_NICK),
|
||||
ptr_server->nick,
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
(string) ? string : "");
|
||||
if (string)
|
||||
free (string);
|
||||
}
|
||||
if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
irc_send_me (ptr_server, ptr_channel, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,7 +166,7 @@ irc_cmd_send_amsg (t_irc_server *server, char *arguments)
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
{
|
||||
server_sendf (ptr_server, "PRIVMSG %s :%s\r\n",
|
||||
ptr_channel->name, arguments);
|
||||
@@ -186,6 +198,78 @@ irc_cmd_send_amsg (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_send_away: toggle away status for one server
|
||||
*/
|
||||
|
||||
void
|
||||
irc_send_away (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *string, buffer[4096];
|
||||
t_gui_window *ptr_window;
|
||||
time_t elapsed;
|
||||
|
||||
if (arguments)
|
||||
{
|
||||
server->is_away = 1;
|
||||
server->away_time = time (NULL);
|
||||
server_sendf (server, "AWAY :%s\r\n", arguments);
|
||||
if (cfg_irc_display_away != CFG_IRC_DISPLAY_AWAY_OFF)
|
||||
{
|
||||
string = (char *)gui_color_decode ((unsigned char *)arguments, 1);
|
||||
if (cfg_irc_display_away == CFG_IRC_DISPLAY_AWAY_LOCAL)
|
||||
irc_display_away (server, "away", (string) ? string : arguments);
|
||||
else
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer), "is away: %s", (string) ? string : arguments);
|
||||
irc_send_me_all_channels (server, buffer);
|
||||
}
|
||||
if (string)
|
||||
free (string);
|
||||
}
|
||||
server_set_away (server, server->nick, 1);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
{
|
||||
if (SERVER(ptr_window->buffer) == server)
|
||||
ptr_window->buffer->last_read_line =
|
||||
ptr_window->buffer->last_line;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
server_sendf (server, "AWAY\r\n");
|
||||
server->is_away = 0;
|
||||
if (server->away_time != 0)
|
||||
{
|
||||
elapsed = time (NULL) - server->away_time;
|
||||
server->away_time = 0;
|
||||
if (cfg_irc_display_away != CFG_IRC_DISPLAY_AWAY_OFF)
|
||||
{
|
||||
if (cfg_irc_display_away == CFG_IRC_DISPLAY_AWAY_LOCAL)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer),
|
||||
"gone %.2ld:%.2ld:%.2ld",
|
||||
(long int)(elapsed / 3600),
|
||||
(long int)((elapsed / 60) % 60),
|
||||
(long int)(elapsed % 60));
|
||||
irc_display_away (server, "back", buffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer),
|
||||
"is back (gone %.2ld:%.2ld:%.2ld)",
|
||||
(long int)(elapsed / 3600),
|
||||
(long int)((elapsed / 60) % 60),
|
||||
(long int)(elapsed % 60));
|
||||
irc_send_me_all_channels (server, buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
server_set_away (server, server->nick, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_away: toggle away status
|
||||
*/
|
||||
@@ -193,12 +277,8 @@ irc_cmd_send_amsg (t_irc_server *server, char *arguments)
|
||||
int
|
||||
irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
{
|
||||
char *pos, *ptr_away_msg;
|
||||
char *ptr_away_default_msg = "away";
|
||||
char *pos;
|
||||
t_irc_server *ptr_server;
|
||||
time_t elapsed;
|
||||
char buffer[4096];
|
||||
char *string;
|
||||
|
||||
gui_add_hotlist = 0;
|
||||
if (arguments && (strncmp (arguments, "-all", 4) == 0))
|
||||
@@ -213,86 +293,12 @@ irc_cmd_send_away (t_irc_server *server, char *arguments)
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (ptr_server->is_connected)
|
||||
{
|
||||
if (ptr_server->is_away && (!pos))
|
||||
{
|
||||
server_sendf (ptr_server, "AWAY\r\n");
|
||||
ptr_server->is_away = 0;
|
||||
if (server->away_time != 0)
|
||||
{
|
||||
elapsed = time (NULL) - ptr_server->away_time;
|
||||
ptr_server->away_time = 0;
|
||||
if (cfg_irc_display_away)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer),
|
||||
"is back (gone %.2ld:%.2ld:%.2ld)",
|
||||
(long int)(elapsed / 3600),
|
||||
(long int)((elapsed / 60) % 60),
|
||||
(long int)(elapsed % 60));
|
||||
irc_send_me_all_channels (ptr_server, buffer);
|
||||
}
|
||||
}
|
||||
server_set_away (ptr_server, ptr_server->nick, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_server->is_away = 1;
|
||||
ptr_server->away_time = time (NULL);
|
||||
ptr_away_msg = (pos) ? pos :
|
||||
((cfg_irc_default_msg_away && cfg_irc_default_msg_away[0]) ?
|
||||
cfg_irc_default_msg_away : ptr_away_default_msg);
|
||||
server_sendf (ptr_server, "AWAY :%s\r\n", ptr_away_msg);
|
||||
if (cfg_irc_display_away)
|
||||
{
|
||||
string = (char *)gui_color_decode ((unsigned char *)ptr_away_msg, 1);
|
||||
snprintf (buffer, sizeof (buffer), "is away: %s", (string) ? string : "");
|
||||
irc_send_me_all_channels (ptr_server, buffer);
|
||||
if (string)
|
||||
free (string);
|
||||
}
|
||||
server_set_away (ptr_server, ptr_server->nick, 1);
|
||||
}
|
||||
}
|
||||
irc_send_away (ptr_server, pos);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (server->is_away && (!arguments))
|
||||
{
|
||||
server_sendf (server, "AWAY\r\n");
|
||||
server->is_away = 0;
|
||||
if (server->away_time != 0)
|
||||
{
|
||||
elapsed = time (NULL) - server->away_time;
|
||||
server->away_time = 0;
|
||||
if (cfg_irc_display_away)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer),
|
||||
"is back (gone %.2ld:%.2ld:%.2ld)",
|
||||
(long int)(elapsed / 3600),
|
||||
(long int)((elapsed / 60) % 60),
|
||||
(long int)(elapsed % 60));
|
||||
irc_send_me_all_channels (server, buffer);
|
||||
}
|
||||
}
|
||||
server_set_away (server, server->nick, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
server->is_away = 1;
|
||||
server->away_time = time (NULL);
|
||||
ptr_away_msg = (arguments) ? arguments :
|
||||
((cfg_irc_default_msg_away && cfg_irc_default_msg_away[0]) ?
|
||||
cfg_irc_default_msg_away : ptr_away_default_msg);
|
||||
server_sendf (server, "AWAY :%s\r\n", ptr_away_msg);
|
||||
if (cfg_irc_display_away)
|
||||
{
|
||||
snprintf (buffer, sizeof (buffer), "is away: %s", ptr_away_msg);
|
||||
irc_send_me_all_channels (server, buffer);
|
||||
}
|
||||
server_set_away (server, server->nick, 1);
|
||||
}
|
||||
}
|
||||
irc_send_away (server, arguments);
|
||||
|
||||
gui_draw_buffer_status (gui_current_window->buffer, 1);
|
||||
gui_add_hotlist = 1;
|
||||
return 0;
|
||||
@@ -338,7 +344,7 @@ irc_cmd_send_ban (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "ban");
|
||||
return -1;
|
||||
}
|
||||
@@ -366,7 +372,7 @@ irc_cmd_send_ban (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "ban");
|
||||
return -1;
|
||||
}
|
||||
@@ -557,7 +563,7 @@ irc_cmd_send_dehalfop (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "dehalfop");
|
||||
}
|
||||
return 0;
|
||||
@@ -590,7 +596,7 @@ irc_cmd_send_deop (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "deop");
|
||||
}
|
||||
return 0;
|
||||
@@ -623,7 +629,7 @@ irc_cmd_send_devoice (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "devoice");
|
||||
return -1;
|
||||
}
|
||||
@@ -671,7 +677,7 @@ irc_cmd_send_halfop (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "halfop");
|
||||
return -1;
|
||||
}
|
||||
@@ -707,7 +713,7 @@ irc_cmd_send_invite (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "invite");
|
||||
return -1;
|
||||
}
|
||||
@@ -774,7 +780,7 @@ irc_cmd_send_kick (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "kick");
|
||||
return -1;
|
||||
}
|
||||
@@ -831,7 +837,7 @@ irc_cmd_send_kickban (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "kickban");
|
||||
return -1;
|
||||
}
|
||||
@@ -911,31 +917,6 @@ irc_cmd_send_lusers (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_send_me: send a ctcp action to a channel
|
||||
*/
|
||||
|
||||
int
|
||||
irc_send_me (t_irc_server *server, t_irc_channel *channel, char *arguments)
|
||||
{
|
||||
char *string;
|
||||
|
||||
server_sendf (server, "PRIVMSG %s :\01ACTION %s\01\r\n",
|
||||
channel->name,
|
||||
(arguments && arguments[0]) ? arguments : "");
|
||||
irc_display_prefix (NULL, channel->buffer, PREFIX_ACTION_ME);
|
||||
string = (arguments && arguments[0]) ?
|
||||
(char *)gui_color_decode ((unsigned char *)arguments, 1) : NULL;
|
||||
gui_printf (channel->buffer, "%s%s %s%s\n",
|
||||
GUI_COLOR(COLOR_WIN_CHAT_NICK),
|
||||
server->nick,
|
||||
GUI_COLOR(COLOR_WIN_CHAT),
|
||||
(string) ? string : "");
|
||||
if (string)
|
||||
free (string);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_send_me_all_channels: send a ctcp action to all channels of a server
|
||||
*/
|
||||
@@ -948,7 +929,7 @@ irc_send_me_all_channels (t_irc_server *server, char *arguments)
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
irc_send_me (server, ptr_channel, arguments);
|
||||
}
|
||||
return 0;
|
||||
@@ -965,7 +946,7 @@ irc_cmd_send_me (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
_("%s \"%s\" command can not be executed on a server buffer\n"),
|
||||
WEECHAT_ERROR, "me");
|
||||
return -1;
|
||||
}
|
||||
@@ -1029,33 +1010,29 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
}
|
||||
if (strcmp (arguments, "*") == 0)
|
||||
{
|
||||
if (BUFFER_IS_SERVER(gui_current_window->buffer))
|
||||
if (!BUFFER_IS_CHANNEL(gui_current_window->buffer) &&
|
||||
!BUFFER_IS_PRIVATE(gui_current_window->buffer))
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel or private buffer\n"),
|
||||
WEECHAT_ERROR, "msg *");
|
||||
return -1;
|
||||
}
|
||||
ptr_channel = CHANNEL(gui_current_window->buffer);
|
||||
ptr_nick = nick_search (ptr_channel, server->nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
string = (char *)gui_color_decode ((unsigned char *)pos, 1);
|
||||
gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, "%s\n",
|
||||
(string) ? string : "");
|
||||
if (string)
|
||||
free (string);
|
||||
}
|
||||
if (BUFFER_IS_CHANNEL(gui_current_window->buffer))
|
||||
ptr_nick = nick_search (ptr_channel, server->nick);
|
||||
else
|
||||
{
|
||||
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s nick \"%s\" not found for \"%s\" command\n"),
|
||||
WEECHAT_ERROR, server->nick, "msg");
|
||||
}
|
||||
ptr_nick = NULL;
|
||||
irc_display_nick (gui_current_window->buffer, ptr_nick,
|
||||
(ptr_nick) ? NULL : server->nick,
|
||||
MSG_TYPE_NICK, 1, 1, 0);
|
||||
string = (char *)gui_color_decode ((unsigned char *)pos, 1);
|
||||
gui_printf_type (gui_current_window->buffer, MSG_TYPE_MSG, "%s\n",
|
||||
(string) ? string : "");
|
||||
if (string)
|
||||
free (string);
|
||||
|
||||
server_sendf (server, "PRIVMSG %s :%s\r\n", ptr_channel->name, pos);
|
||||
}
|
||||
else
|
||||
@@ -1128,15 +1105,16 @@ irc_cmd_send_msg (t_irc_server *server, char *arguments)
|
||||
ptr_channel = channel_search (server, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
ptr_channel = channel_new (server, CHAT_PRIVATE, arguments, 1);
|
||||
ptr_channel = channel_new (server, CHANNEL_TYPE_PRIVATE, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot create new private window \"%s\"\n"),
|
||||
_("%s cannot create new private buffer \"%s\"\n"),
|
||||
WEECHAT_ERROR, arguments);
|
||||
return -1;
|
||||
}
|
||||
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 1);
|
||||
gui_draw_buffer_title (ptr_channel->buffer, 1);
|
||||
}
|
||||
|
||||
@@ -1185,7 +1163,7 @@ irc_cmd_send_names (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "names");
|
||||
return -1;
|
||||
}
|
||||
@@ -1196,6 +1174,31 @@ irc_cmd_send_names (t_irc_server *server, char *arguments)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_nick_server: change nickname on a server
|
||||
*/
|
||||
|
||||
void
|
||||
irc_cmd_send_nick_server (t_irc_server *server, char *nickname)
|
||||
{
|
||||
t_irc_channel *ptr_channel;
|
||||
|
||||
if (server->is_connected)
|
||||
server_sendf (server, "NICK %s\r\n", nickname);
|
||||
else
|
||||
{
|
||||
if (server->nick)
|
||||
free (server->nick);
|
||||
server->nick = strdup (nickname);
|
||||
gui_draw_buffer_input (server->buffer, 1);
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
gui_draw_buffer_input (ptr_channel->buffer, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_cmd_send_nick: change nickname
|
||||
*/
|
||||
@@ -1205,6 +1208,9 @@ irc_cmd_send_nick (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
t_irc_server *ptr_server;
|
||||
|
||||
if (!server)
|
||||
return 0;
|
||||
|
||||
if (argc == 2)
|
||||
{
|
||||
if (strncmp (argv[0], "-all", 4) != 0)
|
||||
@@ -1213,14 +1219,13 @@ irc_cmd_send_nick (t_irc_server *server, int argc, char **argv)
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
if (ptr_server->is_connected)
|
||||
server_sendf (ptr_server, "NICK %s\r\n", argv[1]);
|
||||
irc_cmd_send_nick_server (ptr_server, argv[1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (argc == 1)
|
||||
server_sendf (server, "NICK %s\r\n", argv[0]);
|
||||
irc_cmd_send_nick_server (server, argv[0]);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
@@ -1288,7 +1293,7 @@ irc_cmd_send_op (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "op");
|
||||
return -1;
|
||||
}
|
||||
@@ -1336,7 +1341,7 @@ irc_cmd_send_part (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
_("%s \"%s\" command can not be executed on a server buffer\n"),
|
||||
WEECHAT_ERROR, "part");
|
||||
return -1;
|
||||
}
|
||||
@@ -1350,7 +1355,7 @@ irc_cmd_send_part (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
_("%s \"%s\" command can not be executed on a server buffer\n"),
|
||||
WEECHAT_ERROR, "part");
|
||||
return -1;
|
||||
}
|
||||
@@ -1441,15 +1446,16 @@ irc_cmd_send_query (t_irc_server *server, char *arguments)
|
||||
ptr_channel = channel_search (server, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
ptr_channel = channel_new (server, CHAT_PRIVATE, arguments, 1);
|
||||
ptr_channel = channel_new (server, CHANNEL_TYPE_PRIVATE, arguments);
|
||||
if (!ptr_channel)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s cannot create new private window \"%s\"\n"),
|
||||
_("%s cannot create new private buffer \"%s\"\n"),
|
||||
WEECHAT_ERROR, arguments);
|
||||
return -1;
|
||||
}
|
||||
gui_buffer_new (gui_current_window, server, ptr_channel, 0, 1);
|
||||
gui_draw_buffer_title (ptr_channel->buffer, 1);
|
||||
}
|
||||
else
|
||||
@@ -1694,7 +1700,7 @@ irc_cmd_send_topic (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can not be executed on a server window\n"),
|
||||
_("%s \"%s\" command can not be executed on a server buffer\n"),
|
||||
WEECHAT_ERROR, "topic");
|
||||
return -1;
|
||||
}
|
||||
@@ -1767,7 +1773,7 @@ irc_cmd_send_unban (t_irc_server *server, char *arguments)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "unban");
|
||||
return -1;
|
||||
}
|
||||
@@ -1881,7 +1887,7 @@ irc_cmd_send_voice (t_irc_server *server, int argc, char **argv)
|
||||
{
|
||||
irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
|
||||
gui_printf_nolog (server->buffer,
|
||||
_("%s \"%s\" command can only be executed in a channel window\n"),
|
||||
_("%s \"%s\" command can only be executed in a channel buffer\n"),
|
||||
WEECHAT_ERROR, "voice");
|
||||
return -1;
|
||||
}
|
||||
|
||||
+179
-82
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* irc-server.c: connection and communication with IRC server */
|
||||
@@ -84,6 +84,9 @@ server_init (t_irc_server *server)
|
||||
server->autojoin = NULL;
|
||||
server->autorejoin = 0;
|
||||
server->notify_levels = NULL;
|
||||
server->charset_decode_iso = NULL;
|
||||
server->charset_decode_utf = NULL;
|
||||
server->charset_encode = NULL;
|
||||
|
||||
/* internal vars */
|
||||
server->child_pid = 0;
|
||||
@@ -91,9 +94,7 @@ server_init (t_irc_server *server)
|
||||
server->child_write = -1;
|
||||
server->sock = -1;
|
||||
server->is_connected = 0;
|
||||
#ifdef HAVE_GNUTLS
|
||||
server->ssl_connected = 0;
|
||||
#endif
|
||||
server->unterminated_message = NULL;
|
||||
server->nick = NULL;
|
||||
server->reconnect_start = 0;
|
||||
@@ -296,6 +297,12 @@ server_destroy (t_irc_server *server)
|
||||
free (server->autojoin);
|
||||
if (server->notify_levels)
|
||||
free (server->notify_levels);
|
||||
if (server->charset_decode_iso)
|
||||
free (server->charset_decode_iso);
|
||||
if (server->charset_decode_utf)
|
||||
free (server->charset_decode_utf);
|
||||
if (server->charset_encode)
|
||||
free (server->charset_encode);
|
||||
if (server->unterminated_message)
|
||||
free (server->unterminated_message);
|
||||
if (server->nick)
|
||||
@@ -357,7 +364,8 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
|
||||
int command_line, char *address, int port, int ipv6, int ssl, char *password,
|
||||
char *nick1, char *nick2, char *nick3, char *username,
|
||||
char *realname, char *command, int command_delay, char *autojoin,
|
||||
int autorejoin, char *notify_levels)
|
||||
int autorejoin, char *notify_levels, char *charset_decode_iso,
|
||||
char *charset_decode_utf, char *charset_encode)
|
||||
{
|
||||
t_irc_server *new_server;
|
||||
|
||||
@@ -365,14 +373,18 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
|
||||
return NULL;
|
||||
|
||||
#ifdef DEBUG
|
||||
wee_log_printf ("Creating new server (name:%s, address:%s, port:%d, pwd:%s, "
|
||||
"nick1:%s, nick2:%s, nick3:%s, username:%s, realname:%s, "
|
||||
"command:%s, autojoin:%s, autorejoin:%s, notify_levels:%s)\n",
|
||||
name, address, port, (password) ? password : "",
|
||||
(nick1) ? nick1 : "", (nick2) ? nick2 : "", (nick3) ? nick3 : "",
|
||||
(username) ? username : "", (realname) ? realname : "",
|
||||
(command) ? command : "", (autojoin) ? autojoin : "",
|
||||
(autorejoin) ? "on" : "off", (notify_levels) ? notify_levels : "");
|
||||
weechat_log_printf ("Creating new server (name:%s, address:%s, port:%d, pwd:%s, "
|
||||
"nick1:%s, nick2:%s, nick3:%s, username:%s, realname:%s, "
|
||||
"command:%s, autojoin:%s, autorejoin:%s, notify_levels:%s, "
|
||||
"decode_iso:%s, decode_utf:%s, encode:%s)\n",
|
||||
name, address, port, (password) ? password : "",
|
||||
(nick1) ? nick1 : "", (nick2) ? nick2 : "", (nick3) ? nick3 : "",
|
||||
(username) ? username : "", (realname) ? realname : "",
|
||||
(command) ? command : "", (autojoin) ? autojoin : "",
|
||||
(autorejoin) ? "on" : "off", (notify_levels) ? notify_levels : "",
|
||||
(charset_decode_iso) ? charset_decode_iso : "",
|
||||
(charset_decode_utf) ? charset_decode_utf : "",
|
||||
(charset_encode) ? charset_encode : "");
|
||||
#endif
|
||||
|
||||
if ((new_server = server_alloc ()))
|
||||
@@ -400,15 +412,104 @@ server_new (char *name, int autoconnect, int autoreconnect, int autoreconnect_de
|
||||
new_server->autojoin =
|
||||
(autojoin) ? strdup (autojoin) : NULL;
|
||||
new_server->autorejoin = autorejoin;
|
||||
new_server->nick = strdup (new_server->nick1);
|
||||
new_server->notify_levels =
|
||||
(notify_levels) ? strdup (notify_levels) : NULL;
|
||||
new_server->charset_decode_iso =
|
||||
(charset_decode_iso) ? strdup (charset_decode_iso) : NULL;
|
||||
new_server->charset_decode_utf =
|
||||
(charset_decode_utf) ? strdup (charset_decode_utf) : NULL;
|
||||
new_server->charset_encode =
|
||||
(charset_encode) ? strdup (charset_encode) : NULL;
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
return new_server;
|
||||
}
|
||||
|
||||
/*
|
||||
* server_get_charset_decode_iso: get decode iso value for server
|
||||
* if not found for server, look for global
|
||||
*/
|
||||
|
||||
char *
|
||||
server_get_charset_decode_iso (t_irc_server *server)
|
||||
{
|
||||
char *pos, *result;
|
||||
int length;
|
||||
|
||||
if (!server)
|
||||
return (cfg_look_charset_decode_iso) ?
|
||||
strdup (cfg_look_charset_decode_iso) : strdup ("");
|
||||
|
||||
config_option_list_get_value (&(server->charset_decode_iso),
|
||||
"server", &pos, &length);
|
||||
if (pos && (length > 0))
|
||||
{
|
||||
result = strdup (pos);
|
||||
result[length] = '\0';
|
||||
return result;
|
||||
}
|
||||
|
||||
return (cfg_look_charset_decode_iso) ?
|
||||
strdup (cfg_look_charset_decode_iso) : strdup ("");
|
||||
}
|
||||
|
||||
/*
|
||||
* server_get_charset_decode_utf: get decode utf value for server
|
||||
* if not found for server, look for global
|
||||
*/
|
||||
|
||||
char *
|
||||
server_get_charset_decode_utf (t_irc_server *server)
|
||||
{
|
||||
char *pos, *result;
|
||||
int length;
|
||||
|
||||
if (!server)
|
||||
return (cfg_look_charset_decode_utf) ?
|
||||
strdup (cfg_look_charset_decode_utf) : strdup ("");
|
||||
|
||||
config_option_list_get_value (&(server->charset_decode_utf),
|
||||
"server", &pos, &length);
|
||||
if (pos && (length > 0))
|
||||
{
|
||||
result = strdup (pos);
|
||||
result[length] = '\0';
|
||||
return result;
|
||||
}
|
||||
|
||||
return (cfg_look_charset_decode_utf) ?
|
||||
strdup (cfg_look_charset_decode_utf) : strdup ("");
|
||||
}
|
||||
|
||||
/*
|
||||
* server_get_charset_encode: get encode value for server
|
||||
* if not found for server, look for global
|
||||
*/
|
||||
|
||||
char *
|
||||
server_get_charset_encode (t_irc_server *server)
|
||||
{
|
||||
char *pos, *result;
|
||||
int length;
|
||||
|
||||
if (!server)
|
||||
return (cfg_look_charset_encode) ?
|
||||
strdup (cfg_look_charset_encode) : strdup ("");
|
||||
|
||||
config_option_list_get_value (&(server->charset_encode),
|
||||
"server", &pos, &length);
|
||||
if (pos && (length > 0))
|
||||
{
|
||||
result = strdup (pos);
|
||||
result[length] = '\0';
|
||||
return result;
|
||||
}
|
||||
|
||||
return (cfg_look_charset_encode) ?
|
||||
strdup (cfg_look_charset_encode) : strdup ("");
|
||||
}
|
||||
|
||||
/*
|
||||
* server_send: send data to IRC server
|
||||
*/
|
||||
@@ -436,7 +537,6 @@ server_sendf (t_irc_server *server, char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
static char buffer[4096];
|
||||
char *buf2;
|
||||
int size_buf;
|
||||
|
||||
if (!server)
|
||||
@@ -457,17 +557,12 @@ server_sendf (t_irc_server *server, char *fmt, ...)
|
||||
gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer);
|
||||
buffer[size_buf - 2] = '\r';
|
||||
#endif
|
||||
buf2 = weechat_convert_encoding ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
cfg_look_charset_encode,
|
||||
buffer);
|
||||
if (server_send (server, buf2, strlen (buf2)) <= 0)
|
||||
if (server_send (server, buffer, strlen (buffer)) <= 0)
|
||||
{
|
||||
irc_display_prefix (server, server->buffer, PREFIX_ERROR);
|
||||
gui_printf (server->buffer, _("%s error sending data to IRC server\n"),
|
||||
WEECHAT_ERROR);
|
||||
}
|
||||
free (buf2);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -802,9 +897,7 @@ server_close_connection (t_irc_server *server)
|
||||
|
||||
/* server is now disconnected */
|
||||
server->is_connected = 0;
|
||||
#ifdef HAVE_GNUTLS
|
||||
server->ssl_connected = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1400,12 +1493,12 @@ server_connect (t_irc_server *server)
|
||||
(server->ssl) ? " (SSL)" : "",
|
||||
cfg_proxy_type_values[cfg_proxy_type], cfg_proxy_address, cfg_proxy_port,
|
||||
(cfg_proxy_ipv6) ? " (IPv6)" : "");
|
||||
wee_log_printf (_("Connecting to server %s:%d%s%s via %s proxy %s:%d%s...\n"),
|
||||
server->address, server->port,
|
||||
(server->ipv6) ? " (IPv6)" : "",
|
||||
(server->ssl) ? " (SSL)" : "",
|
||||
cfg_proxy_type_values[cfg_proxy_type], cfg_proxy_address, cfg_proxy_port,
|
||||
(cfg_proxy_ipv6) ? " (IPv6)" : "");
|
||||
weechat_log_printf (_("Connecting to server %s:%d%s%s via %s proxy %s:%d%s...\n"),
|
||||
server->address, server->port,
|
||||
(server->ipv6) ? " (IPv6)" : "",
|
||||
(server->ssl) ? " (SSL)" : "",
|
||||
cfg_proxy_type_values[cfg_proxy_type], cfg_proxy_address, cfg_proxy_port,
|
||||
(cfg_proxy_ipv6) ? " (IPv6)" : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1414,18 +1507,18 @@ server_connect (t_irc_server *server)
|
||||
PACKAGE_NAME, server->address, server->port,
|
||||
(server->ipv6) ? " (IPv6)" : "",
|
||||
(server->ssl) ? " (SSL)" : "");
|
||||
wee_log_printf (_("Connecting to server %s:%d%s%s...\n"),
|
||||
server->address, server->port,
|
||||
(server->ipv6) ? " (IPv6)" : "",
|
||||
(server->ssl) ? " (SSL)" : "");
|
||||
weechat_log_printf (_("Connecting to server %s:%d%s%s...\n"),
|
||||
server->address, server->port,
|
||||
(server->ipv6) ? " (IPv6)" : "",
|
||||
(server->ssl) ? " (SSL)" : "");
|
||||
}
|
||||
|
||||
/* close any opened connection and kill child process if running */
|
||||
server_close_connection (server);
|
||||
|
||||
/* init SSL if asked */
|
||||
#ifdef HAVE_GNUTLS
|
||||
server->ssl_connected = 0;
|
||||
#ifdef HAVE_GNUTLS
|
||||
if (server->ssl)
|
||||
{
|
||||
if (gnutls_init (&server->gnutls_sess, GNUTLS_CLIENT) != 0)
|
||||
@@ -1707,7 +1800,7 @@ server_remove_away ()
|
||||
{
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
channel_remove_away (ptr_channel);
|
||||
}
|
||||
}
|
||||
@@ -1730,7 +1823,7 @@ server_check_away ()
|
||||
{
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
channel_check_away (ptr_server, ptr_channel);
|
||||
}
|
||||
}
|
||||
@@ -1750,7 +1843,7 @@ server_set_away (t_irc_server *server, char *nick, int is_away)
|
||||
{
|
||||
if (server->is_connected)
|
||||
{
|
||||
if (ptr_channel->type == CHAT_CHANNEL)
|
||||
if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
|
||||
channel_set_away (ptr_channel, nick, is_away);
|
||||
}
|
||||
}
|
||||
@@ -1763,49 +1856,53 @@ server_set_away (t_irc_server *server, char *nick, int is_away)
|
||||
void
|
||||
server_print_log (t_irc_server *server)
|
||||
{
|
||||
wee_log_printf ("[server %s (addr:0x%X)]\n", server->name, server);
|
||||
wee_log_printf (" autoconnect . . . . : %d\n", server->autoconnect);
|
||||
wee_log_printf (" autoreconnect . . . : %d\n", server->autoreconnect);
|
||||
wee_log_printf (" autoreconnect_delay : %d\n", server->autoreconnect_delay);
|
||||
wee_log_printf (" command_line. . . . : %d\n", server->command_line);
|
||||
wee_log_printf (" address . . . . . . : '%s'\n", server->address);
|
||||
wee_log_printf (" port. . . . . . . . : %d\n", server->port);
|
||||
wee_log_printf (" ipv6. . . . . . . . : %d\n", server->ipv6);
|
||||
wee_log_printf (" ssl . . . . . . . . : %d\n", server->ssl);
|
||||
wee_log_printf (" password. . . . . . : '%s'\n",
|
||||
(server->password && server->password[0]) ? "(hidden)" : server->password);
|
||||
wee_log_printf (" nick1 . . . . . . . : '%s'\n", server->nick1);
|
||||
wee_log_printf (" nick2 . . . . . . . : '%s'\n", server->nick2);
|
||||
wee_log_printf (" nick3 . . . . . . . : '%s'\n", server->nick3);
|
||||
wee_log_printf (" username. . . . . . : '%s'\n", server->username);
|
||||
wee_log_printf (" realname. . . . . . : '%s'\n", server->realname);
|
||||
wee_log_printf (" command . . . . . . : '%s'\n",
|
||||
(server->command && server->command[0]) ? "(hidden)" : server->command);
|
||||
wee_log_printf (" command_delay . . . : %d\n", server->command_delay);
|
||||
wee_log_printf (" autojoin. . . . . . : '%s'\n", server->autojoin);
|
||||
wee_log_printf (" autorejoin. . . . . : %d\n", server->autorejoin);
|
||||
wee_log_printf (" notify_levels . . . : %s\n", server->notify_levels);
|
||||
wee_log_printf (" child_pid . . . . . : %d\n", server->child_pid);
|
||||
wee_log_printf (" child_read . . . . : %d\n", server->child_read);
|
||||
wee_log_printf (" child_write . . . . : %d\n", server->child_write);
|
||||
wee_log_printf (" sock. . . . . . . . : %d\n", server->sock);
|
||||
wee_log_printf (" is_connected. . . . : %d\n", server->is_connected);
|
||||
#ifdef HAVE_GNUTLS
|
||||
wee_log_printf(" ssl_connected . . . : %d\n", server->ssl_connected);
|
||||
#endif
|
||||
wee_log_printf (" unterminated_message: '%s'\n", server->unterminated_message);
|
||||
wee_log_printf (" nick. . . . . . . . : '%s'\n", server->nick);
|
||||
wee_log_printf (" reconnect_start . . : %ld\n", server->reconnect_start);
|
||||
wee_log_printf (" reconnect_join. . . : %d\n", server->reconnect_join);
|
||||
wee_log_printf (" is_away . . . . . . : %d\n", server->is_away);
|
||||
wee_log_printf (" away_time . . . . . : %ld\n", server->away_time);
|
||||
wee_log_printf (" lag . . . . . . . . : %d\n", server->lag);
|
||||
wee_log_printf (" lag_check_time. . . : tv_sec:%d, tv_usec:%d\n",
|
||||
server->lag_check_time.tv_sec, server->lag_check_time.tv_usec);
|
||||
wee_log_printf (" lag_next_check. . . : %ld\n", server->lag_next_check);
|
||||
wee_log_printf (" buffer. . . . . . . : 0x%X\n", server->buffer);
|
||||
wee_log_printf (" channels. . . . . . : 0x%X\n", server->channels);
|
||||
wee_log_printf (" last_channel. . . . : 0x%X\n", server->last_channel);
|
||||
wee_log_printf (" prev_server . . . . : 0x%X\n", server->prev_server);
|
||||
wee_log_printf (" next_server . . . . : 0x%X\n", server->next_server);
|
||||
weechat_log_printf ("[server %s (addr:0x%X)]\n", server->name, server);
|
||||
weechat_log_printf (" autoconnect . . . . : %d\n", server->autoconnect);
|
||||
weechat_log_printf (" autoreconnect . . . : %d\n", server->autoreconnect);
|
||||
weechat_log_printf (" autoreconnect_delay : %d\n", server->autoreconnect_delay);
|
||||
weechat_log_printf (" command_line. . . . : %d\n", server->command_line);
|
||||
weechat_log_printf (" address . . . . . . : '%s'\n", server->address);
|
||||
weechat_log_printf (" port. . . . . . . . : %d\n", server->port);
|
||||
weechat_log_printf (" ipv6. . . . . . . . : %d\n", server->ipv6);
|
||||
weechat_log_printf (" ssl . . . . . . . . : %d\n", server->ssl);
|
||||
weechat_log_printf (" password. . . . . . : '%s'\n",
|
||||
(server->password && server->password[0]) ?
|
||||
"(hidden)" : server->password);
|
||||
weechat_log_printf (" nick1 . . . . . . . : '%s'\n", server->nick1);
|
||||
weechat_log_printf (" nick2 . . . . . . . : '%s'\n", server->nick2);
|
||||
weechat_log_printf (" nick3 . . . . . . . : '%s'\n", server->nick3);
|
||||
weechat_log_printf (" username. . . . . . : '%s'\n", server->username);
|
||||
weechat_log_printf (" realname. . . . . . : '%s'\n", server->realname);
|
||||
weechat_log_printf (" command . . . . . . : '%s'\n",
|
||||
(server->command && server->command[0]) ?
|
||||
"(hidden)" : server->command);
|
||||
weechat_log_printf (" command_delay . . . : %d\n", server->command_delay);
|
||||
weechat_log_printf (" autojoin. . . . . . : '%s'\n", server->autojoin);
|
||||
weechat_log_printf (" autorejoin. . . . . : %d\n", server->autorejoin);
|
||||
weechat_log_printf (" notify_levels . . . : %s\n", server->notify_levels);
|
||||
weechat_log_printf (" charset_decode_iso. : %s\n", server->charset_decode_iso);
|
||||
weechat_log_printf (" charset_decode_utf. : %s\n", server->charset_decode_utf);
|
||||
weechat_log_printf (" charset_encode. . . : %s\n", server->charset_encode);
|
||||
weechat_log_printf (" child_pid . . . . . : %d\n", server->child_pid);
|
||||
weechat_log_printf (" child_read . . . . : %d\n", server->child_read);
|
||||
weechat_log_printf (" child_write . . . . : %d\n", server->child_write);
|
||||
weechat_log_printf (" sock. . . . . . . . : %d\n", server->sock);
|
||||
weechat_log_printf (" is_connected. . . . : %d\n", server->is_connected);
|
||||
weechat_log_printf (" ssl_connected . . . : %d\n", server->ssl_connected);
|
||||
weechat_log_printf (" unterminated_message: '%s'\n", server->unterminated_message);
|
||||
weechat_log_printf (" nick. . . . . . . . : '%s'\n", server->nick);
|
||||
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_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",
|
||||
server->lag_check_time.tv_sec,
|
||||
server->lag_check_time.tv_usec);
|
||||
weechat_log_printf (" lag_next_check. . . : %ld\n", server->lag_next_check);
|
||||
weechat_log_printf (" buffer. . . . . . . : 0x%X\n", server->buffer);
|
||||
weechat_log_printf (" channels. . . . . . : 0x%X\n", server->channels);
|
||||
weechat_log_printf (" last_channel. . . . : 0x%X\n", server->last_channel);
|
||||
weechat_log_printf (" prev_server . . . . : 0x%X\n", server->prev_server);
|
||||
weechat_log_printf (" next_server . . . . : 0x%X\n", server->next_server);
|
||||
}
|
||||
|
||||
+186
-163
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2005 by FlashCode <flashcode@flashtux.org>
|
||||
* 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
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
@@ -45,10 +45,43 @@
|
||||
#define PREFIX_QUIT "<--"
|
||||
#define PREFIX_ERROR "=!="
|
||||
#define PREFIX_PLUGIN "-P-"
|
||||
#define PREFIX_AWAY "-A-"
|
||||
|
||||
#define DEFAULT_IRC_PORT 6667
|
||||
|
||||
/* nick types */
|
||||
|
||||
#define NICK_CHANOWNER 1
|
||||
#define NICK_CHANADMIN 2
|
||||
#define NICK_OP 4
|
||||
#define NICK_HALFOP 8
|
||||
#define NICK_VOICE 16
|
||||
#define NICK_AWAY 32
|
||||
#define NICK_SET_FLAG(nick, set, flag) \
|
||||
if (set) \
|
||||
nick->flags |= flag; \
|
||||
else \
|
||||
nick->flags &= 0xFFFF - flag;
|
||||
|
||||
typedef struct t_irc_nick t_irc_nick;
|
||||
|
||||
struct t_irc_nick
|
||||
{
|
||||
char *nick; /* nickname */
|
||||
int flags; /* chanowner/chanadmin (unrealircd), */
|
||||
/* op, halfop, voice, away */
|
||||
int color; /* color for nickname in chat window */
|
||||
t_irc_nick *prev_nick; /* link to previous nick on the channel */
|
||||
t_irc_nick *next_nick; /* link to next nick on the channel */
|
||||
};
|
||||
|
||||
/* channel types */
|
||||
|
||||
#define CHANNEL_PREFIX "#&+!"
|
||||
|
||||
/* channel modes */
|
||||
#define CHANNEL_TYPE_UNKNOWN -1
|
||||
#define CHANNEL_TYPE_CHANNEL 0
|
||||
#define CHANNEL_TYPE_PRIVATE 1
|
||||
|
||||
#define NUM_CHANNEL_MODES 7
|
||||
#define CHANNEL_MODE_INVITE 0
|
||||
@@ -58,78 +91,30 @@
|
||||
#define CHANNEL_MODE_NO_MSG_OUT 4
|
||||
#define CHANNEL_MODE_SECRET 5
|
||||
#define CHANNEL_MODE_TOPIC 6
|
||||
#define SET_CHANNEL_MODE(channel, set, mode) \
|
||||
#define CHANNEL_SET_MODE(channel, set, mode) \
|
||||
if (set) \
|
||||
channel->modes[mode] = channel_modes[mode]; \
|
||||
else \
|
||||
channel->modes[mode] = ' ';
|
||||
|
||||
#define DEFAULT_IRC_PORT 6667
|
||||
|
||||
/* DCC types & status */
|
||||
|
||||
#define DCC_CHAT_RECV 0 /* receiving DCC chat */
|
||||
#define DCC_CHAT_SEND 1 /* sending DCC chat */
|
||||
#define DCC_FILE_RECV 2 /* incoming DCC file */
|
||||
#define DCC_FILE_SEND 3 /* sending DCC file */
|
||||
|
||||
#define DCC_WAITING 0 /* waiting for host answer */
|
||||
#define DCC_CONNECTING 1 /* connecting to host */
|
||||
#define DCC_ACTIVE 2 /* sending/receiving data */
|
||||
#define DCC_DONE 3 /* transfer done */
|
||||
#define DCC_FAILED 4 /* DCC failed */
|
||||
#define DCC_ABORTED 5 /* DCC aborted by user */
|
||||
|
||||
#define DCC_IS_CHAT(type) ((type == DCC_CHAT_RECV) || (type == DCC_CHAT_SEND))
|
||||
#define DCC_IS_FILE(type) ((type == DCC_FILE_RECV) || (type == DCC_FILE_SEND))
|
||||
#define DCC_IS_RECV(type) ((type == DCC_CHAT_RECV) || (type == DCC_FILE_RECV))
|
||||
#define DCC_IS_SEND(type) ((type == DCC_CHAT_SEND) || (type == DCC_FILE_SEND))
|
||||
|
||||
#define DCC_ENDED(status) ((status == DCC_DONE) || (status == DCC_FAILED) || \
|
||||
(status == DCC_ABORTED))
|
||||
|
||||
/* nick types */
|
||||
|
||||
typedef struct t_irc_nick t_irc_nick;
|
||||
|
||||
struct t_irc_nick
|
||||
{
|
||||
char *nick; /* nickname */
|
||||
int is_chanowner; /* chan owner? (specific to unrealircd) */
|
||||
int is_chanadmin; /* chan admin? (specific to unrealircd) */
|
||||
int is_op; /* operator privileges? */
|
||||
int is_halfop; /* half operator privileges? */
|
||||
int has_voice; /* nick has voice? */
|
||||
int is_away; /* = 1 if nick is away, otherwise 0 */
|
||||
int color; /* color for nickname in chat window */
|
||||
t_irc_nick *prev_nick; /* link to previous nick on the channel */
|
||||
t_irc_nick *next_nick; /* link to next nick on the channel */
|
||||
};
|
||||
|
||||
/* channel types */
|
||||
|
||||
typedef struct t_irc_channel t_irc_channel;
|
||||
|
||||
#define CHAT_UNKNOWN -1
|
||||
#define CHAT_CHANNEL 0
|
||||
#define CHAT_PRIVATE 1
|
||||
|
||||
struct t_irc_channel
|
||||
{
|
||||
int type; /* channel type */
|
||||
void *dcc_chat; /* DCC CHAT pointer (NULL if not DCC) */
|
||||
char *name; /* name of channel (exemple: "#abc") */
|
||||
char *topic; /* topic of channel (host for private) */
|
||||
char modes[NUM_CHANNEL_MODES+1];/* channel modes */
|
||||
int limit; /* user limit (0 is limit not set) */
|
||||
char *key; /* channel key (NULL if no key is set) */
|
||||
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
|
||||
int checking_away; /* = 1 if checking away with WHO cmd */
|
||||
t_irc_nick *nicks; /* nicks on the channel */
|
||||
t_irc_nick *last_nick; /* last nick on the channel */
|
||||
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
|
||||
t_irc_channel *prev_channel; /* link to previous channel */
|
||||
t_irc_channel *next_channel; /* link to next channel */
|
||||
int type; /* channel type */
|
||||
void *dcc_chat; /* DCC CHAT pointer (NULL if not DCC) */
|
||||
char *name; /* name of channel (exemple: "#abc") */
|
||||
char *topic; /* topic of channel (host for private) */
|
||||
char *modes; /* channel modes */
|
||||
int limit; /* user limit (0 is limit not set) */
|
||||
char *key; /* channel key (NULL if no key is set) */
|
||||
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
|
||||
int checking_away; /* = 1 if checking away with WHO cmd */
|
||||
t_irc_nick *nicks; /* nicks on the channel */
|
||||
t_irc_nick *last_nick; /* last nick on the channel */
|
||||
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
|
||||
t_irc_channel *prev_channel; /* link to previous channel */
|
||||
t_irc_channel *next_channel; /* link to next channel */
|
||||
};
|
||||
|
||||
/* server types */
|
||||
@@ -139,53 +124,55 @@ typedef struct t_irc_server t_irc_server;
|
||||
struct t_irc_server
|
||||
{
|
||||
/* user choices */
|
||||
char *name; /* name of server (only for display) */
|
||||
int autoconnect; /* = 1 if auto connect at startup */
|
||||
int autoreconnect; /* = 1 if auto reco when disconnected */
|
||||
int autoreconnect_delay; /* delay before trying again reconnect */
|
||||
int command_line; /* server was given on command line */
|
||||
char *address; /* address of server (IP or name) */
|
||||
int port; /* port for server (6667 by default) */
|
||||
int ipv6; /* use IPv6 protocol */
|
||||
int ssl; /* SSL protocol */
|
||||
char *password; /* password for server */
|
||||
char *nick1; /* first nickname for the server */
|
||||
char *nick2; /* alternate nickname */
|
||||
char *nick3; /* 2nd alternate nickname */
|
||||
char *username; /* user name */
|
||||
char *realname; /* real name */
|
||||
char *command; /* command to run once connected */
|
||||
int command_delay; /* delay after execution of command */
|
||||
char *autojoin; /* channels to automatically join */
|
||||
int autorejoin; /* auto rejoin channels when kicked */
|
||||
char *notify_levels; /* channels notify levels */
|
||||
char *name; /* name of server (only for display) */
|
||||
int autoconnect; /* = 1 if auto connect at startup */
|
||||
int autoreconnect; /* = 1 if auto reco when disconnected */
|
||||
int autoreconnect_delay; /* delay before trying again reconnect */
|
||||
int command_line; /* server was given on command line */
|
||||
char *address; /* address of server (IP or name) */
|
||||
int port; /* port for server (6667 by default) */
|
||||
int ipv6; /* use IPv6 protocol */
|
||||
int ssl; /* SSL protocol */
|
||||
char *password; /* password for server */
|
||||
char *nick1; /* first nickname for the server */
|
||||
char *nick2; /* alternate nickname */
|
||||
char *nick3; /* 2nd alternate nickname */
|
||||
char *username; /* user name */
|
||||
char *realname; /* real name */
|
||||
char *command; /* command to run once connected */
|
||||
int command_delay; /* delay after execution of command */
|
||||
char *autojoin; /* channels to automatically join */
|
||||
int autorejoin; /* auto rejoin channels when kicked */
|
||||
char *notify_levels; /* channels notify levels */
|
||||
char *charset_decode_iso; /* channels charsets for decoding ISO */
|
||||
char *charset_decode_utf; /* channels charsets for decoding UTF */
|
||||
char *charset_encode; /* channels charsets for encoding msgs */
|
||||
|
||||
/* internal vars */
|
||||
pid_t child_pid; /* pid of child process (connecting) */
|
||||
int child_read; /* to read into child pipe */
|
||||
int child_write; /* to write into child pipe */
|
||||
int sock; /* socket for server (IPv4 or IPv6) */
|
||||
int is_connected; /* 1 if WeeChat is connected to server */
|
||||
pid_t child_pid; /* pid of child process (connecting) */
|
||||
int child_read; /* to read into child pipe */
|
||||
int child_write; /* to write into child pipe */
|
||||
int sock; /* socket for server (IPv4 or IPv6) */
|
||||
int is_connected; /* 1 if WeeChat is connected to server */
|
||||
int ssl_connected; /* = 1 if connected with SSL */
|
||||
#ifdef HAVE_GNUTLS
|
||||
int ssl_connected; /* = 1 if connected with SSL */
|
||||
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
|
||||
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
|
||||
#endif
|
||||
|
||||
char *unterminated_message; /* beginning of a message in input buf */
|
||||
char *nick; /* current nickname */
|
||||
time_t reconnect_start; /* this time + delay = reconnect time */
|
||||
int reconnect_join; /* 1 if channels opened to rejoin */
|
||||
int is_away; /* 1 is user is marker as away */
|
||||
time_t away_time; /* time() when user marking as away */
|
||||
int lag; /* lag (in milliseconds) */
|
||||
struct timeval lag_check_time; /* last time lag was checked (ping sent)*/
|
||||
time_t lag_next_check; /* time for next check */
|
||||
t_gui_buffer *buffer; /* GUI buffer allocated for server */
|
||||
t_gui_buffer *saved_buffer; /* channel before jumping to next server*/
|
||||
t_irc_channel *channels; /* opened channels on server */
|
||||
t_irc_channel *last_channel; /* last opened channal on server */
|
||||
t_irc_server *prev_server; /* link to previous server */
|
||||
t_irc_server *next_server; /* link to next server */
|
||||
char *unterminated_message; /* beginning of a message in input buf */
|
||||
char *nick; /* current nickname */
|
||||
time_t reconnect_start; /* this time + delay = reconnect time */
|
||||
int reconnect_join; /* 1 if channels opened to rejoin */
|
||||
int is_away; /* 1 is user is marker as away */
|
||||
time_t away_time; /* time() when user marking as away */
|
||||
int lag; /* lag (in milliseconds) */
|
||||
struct timeval lag_check_time; /* last time lag was checked (ping sent) */
|
||||
time_t lag_next_check; /* time for next check */
|
||||
t_gui_buffer *buffer; /* GUI buffer allocated for server */
|
||||
t_gui_buffer *saved_buffer; /* channel before jumping to next server */
|
||||
t_irc_channel *channels; /* opened channels on server */
|
||||
t_irc_channel *last_channel; /* last opened channal on server */
|
||||
t_irc_server *prev_server; /* link to previous server */
|
||||
t_irc_server *next_server; /* link to next server */
|
||||
};
|
||||
|
||||
/* irc commands */
|
||||
@@ -194,18 +181,20 @@ typedef struct t_irc_command t_irc_command;
|
||||
|
||||
struct t_irc_command
|
||||
{
|
||||
char *command_name; /* command name (internal or IRC cmd) */
|
||||
char *command_description; /* command description */
|
||||
char *arguments; /* command parameters */
|
||||
char *arguments_description; /* parameters description */
|
||||
int min_arg, max_arg; /* min & max number of parameters */
|
||||
int need_connection; /* = 1 if cmd needs server connection */
|
||||
char *command_name; /* IRC command name */
|
||||
char *command_description; /* command description (for /help) */
|
||||
char *arguments; /* command arguments (for /help) */
|
||||
char *arguments_description; /* arguments description (for /help) */
|
||||
char *completion_template; /* template for completion */
|
||||
/* NULL=no completion, ""=default (nick) */
|
||||
int min_arg, max_arg; /* min & max number of arguments */
|
||||
int need_connection; /* = 1 if cmd needs server connection */
|
||||
int (*cmd_function_args)(t_irc_server *, int, char **);
|
||||
/* function called when user enters cmd */
|
||||
/* function called when user enters cmd */
|
||||
int (*cmd_function_1arg)(t_irc_server *, char *);
|
||||
/* function called when user enters cmd */
|
||||
/* function called when user enters cmd */
|
||||
int (*recv_function)(t_irc_server *, char *, char *, char *);
|
||||
/* function called when cmd is received */
|
||||
/* function called when cmd is received */
|
||||
};
|
||||
|
||||
/* irc messages */
|
||||
@@ -214,48 +203,69 @@ typedef struct t_irc_message t_irc_message;
|
||||
|
||||
struct t_irc_message
|
||||
{
|
||||
t_irc_server *server; /* server pointer for received msg */
|
||||
char *data; /* message content */
|
||||
t_irc_message *next_message; /* link to next message */
|
||||
t_irc_server *server; /* server pointer for received msg */
|
||||
char *data; /* message content */
|
||||
t_irc_message *next_message; /* link to next 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_WAITING 0 /* waiting for host answer */
|
||||
#define DCC_CONNECTING 1 /* connecting to host */
|
||||
#define DCC_ACTIVE 2 /* sending/receiving data */
|
||||
#define DCC_DONE 3 /* transfer done */
|
||||
#define DCC_FAILED 4 /* DCC failed */
|
||||
#define DCC_ABORTED 5 /* DCC aborted by user */
|
||||
|
||||
#define DCC_IS_CHAT(type) ((type == DCC_CHAT_RECV) || (type == DCC_CHAT_SEND))
|
||||
#define DCC_IS_FILE(type) ((type == DCC_FILE_RECV) || (type == DCC_FILE_SEND))
|
||||
#define DCC_IS_RECV(type) ((type == DCC_CHAT_RECV) || (type == DCC_FILE_RECV))
|
||||
#define DCC_IS_SEND(type) ((type == DCC_CHAT_SEND) || (type == DCC_FILE_SEND))
|
||||
|
||||
#define DCC_ENDED(status) ((status == DCC_DONE) || (status == DCC_FAILED) || \
|
||||
(status == DCC_ABORTED))
|
||||
|
||||
typedef struct t_irc_dcc t_irc_dcc;
|
||||
|
||||
struct t_irc_dcc
|
||||
{
|
||||
t_irc_server *server; /* irc server */
|
||||
t_irc_channel *channel; /* irc channel (for DCC chat only) */
|
||||
int type; /* DCC type (send or receive) */
|
||||
int status; /* DCC status (waiting, sending, ..) */
|
||||
time_t start_time; /* the time when DCC started */
|
||||
time_t start_transfer; /* the time when DCC transfer started */
|
||||
unsigned long addr; /* IP address */
|
||||
int port; /* port */
|
||||
char *nick; /* remote nick */
|
||||
int sock; /* socket for connection */
|
||||
char *unterminated_message; /* beginning of a message in input buf */
|
||||
int file; /* local file (for reading or writing) */
|
||||
char *filename; /* filename (given by sender) */
|
||||
char *local_filename; /* local filename (with path) */
|
||||
int filename_suffix; /* suffix (.1 for ex) if renaming file */
|
||||
unsigned long size; /* file size */
|
||||
unsigned long pos; /* number of bytes received/sent */
|
||||
unsigned long ack; /* number of bytes received OK */
|
||||
unsigned long start_resume; /* start of resume (in bytes) */
|
||||
time_t last_check_time; /* last time we looked at bytes sent/rcv*/
|
||||
unsigned long last_check_pos; /* bytes sent/recv at last check */
|
||||
unsigned long bytes_per_sec; /* bytes per second */
|
||||
time_t last_activity; /* time of last byte received/sent */
|
||||
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
|
||||
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
|
||||
t_irc_server *server; /* irc server */
|
||||
t_irc_channel *channel; /* irc channel (for DCC chat only) */
|
||||
int type; /* DCC type (send or receive) */
|
||||
int status; /* DCC status (waiting, sending, ..) */
|
||||
time_t start_time; /* the time when DCC started */
|
||||
time_t start_transfer; /* the time when DCC transfer started */
|
||||
unsigned long addr; /* IP address */
|
||||
int port; /* port */
|
||||
char *nick; /* remote nick */
|
||||
int sock; /* socket for connection */
|
||||
char *unterminated_message; /* beginning of a message in input buf */
|
||||
int file; /* local file (for reading or writing) */
|
||||
char *filename; /* filename (given by sender) */
|
||||
char *local_filename; /* local filename (with path) */
|
||||
int filename_suffix; /* suffix (.1 for ex) if renaming file */
|
||||
unsigned long size; /* file size */
|
||||
unsigned long pos; /* number of bytes received/sent */
|
||||
unsigned long ack; /* number of bytes received OK */
|
||||
unsigned long start_resume; /* start of resume (in bytes) */
|
||||
time_t last_check_time; /* last time we looked at bytes sent/recv */
|
||||
unsigned long last_check_pos; /* bytes sent/recv at last check */
|
||||
time_t last_activity; /* time of last byte received/sent */
|
||||
unsigned long bytes_per_sec; /* bytes per second */
|
||||
unsigned long eta; /* estimated time of arrival */
|
||||
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
|
||||
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
|
||||
};
|
||||
|
||||
/* ignore types */
|
||||
|
||||
/* pre-defined ignore types, all other types are made with IRC commands */
|
||||
/* for example: part join quit notice invite ... */
|
||||
/* pre-defined ignore types, all other types are made with IRC commands */
|
||||
/* for example: part join quit notice invite ... */
|
||||
|
||||
#define IGNORE_ACTION "action"
|
||||
#define IGNORE_CTCP "ctcp"
|
||||
@@ -266,12 +276,12 @@ typedef struct t_irc_ignore t_irc_ignore;
|
||||
|
||||
struct t_irc_ignore
|
||||
{
|
||||
char *mask; /* nickname or mask */
|
||||
char *type; /* type of ignore */
|
||||
char *channel_name; /* name of channel, "*" == all */
|
||||
char *server_name; /* name of server, "*" == all */
|
||||
t_irc_ignore *prev_ignore; /* pointer to previous ignore */
|
||||
t_irc_ignore *next_ignore; /* pointer to next ignore */
|
||||
char *mask; /* nickname or mask */
|
||||
char *type; /* type of ignore */
|
||||
char *channel_name; /* name of channel, "*" == all */
|
||||
char *server_name; /* name of server, "*" == all */
|
||||
t_irc_ignore *prev_ignore; /* pointer to previous ignore */
|
||||
t_irc_ignore *next_ignore; /* pointer to next ignore */
|
||||
};
|
||||
|
||||
/* variables */
|
||||
@@ -297,7 +307,11 @@ extern void server_free (t_irc_server *);
|
||||
extern void server_free_all ();
|
||||
extern t_irc_server *server_new (char *, int, int, int, int, char *, int, int, int,
|
||||
char *, char *, char *, char *, char *, char *,
|
||||
char *, int, char *, int, char *);
|
||||
char *, int, char *, int, char *, char *, char *,
|
||||
char *);
|
||||
extern char *server_get_charset_decode_iso (t_irc_server *);
|
||||
extern char *server_get_charset_decode_utf (t_irc_server *);
|
||||
extern char *server_get_charset_encode (t_irc_server *);
|
||||
extern int server_send (t_irc_server *, char *, int);
|
||||
extern void server_sendf (t_irc_server *, char *, ...);
|
||||
extern void server_recv (t_irc_server *);
|
||||
@@ -327,25 +341,30 @@ extern int pass_proxy(int, char*, int, char*);
|
||||
|
||||
/* channel functions (irc-channel.c) */
|
||||
|
||||
extern t_irc_channel *channel_new (t_irc_server *, int, char *, int);
|
||||
extern t_irc_channel *channel_new (t_irc_server *, int, char *);
|
||||
extern void channel_free (t_irc_server *, t_irc_channel *);
|
||||
extern void channel_free_all (t_irc_server *);
|
||||
extern t_irc_channel *channel_search (t_irc_server *, char *);
|
||||
extern int string_is_channel (char *);
|
||||
extern char *channel_get_charset_decode_iso (t_irc_server *, t_irc_channel *);
|
||||
extern char *channel_get_charset_decode_utf (t_irc_server *, t_irc_channel *);
|
||||
extern char *channel_get_charset_encode (t_irc_server *, t_irc_channel *);
|
||||
extern char *channel_iconv_decode (t_irc_server *, t_irc_channel *, char *);
|
||||
extern char *channel_iconv_encode (t_irc_server *, t_irc_channel *, char *);
|
||||
extern void channel_remove_away (t_irc_channel *);
|
||||
extern void channel_check_away (t_irc_server *, t_irc_channel *);
|
||||
extern void channel_set_away (t_irc_channel *, char *, int);
|
||||
extern int channel_create_dcc (t_irc_dcc *);
|
||||
extern void channel_remove_dcc (t_irc_dcc *);
|
||||
extern int channel_get_notify_level (t_irc_server *, t_irc_channel *);
|
||||
extern void channel_remove_notify_level (t_irc_server *, t_irc_channel *);
|
||||
extern void channel_set_notify_level (t_irc_server *, t_irc_channel *, int);
|
||||
extern void channel_print_log (t_irc_channel *);
|
||||
|
||||
/* nick functions (irc-nick.c) */
|
||||
|
||||
extern int nick_find_color (t_irc_nick *);
|
||||
extern t_irc_nick *nick_new (t_irc_channel *, char *, int, int, int, int, int);
|
||||
extern t_irc_nick *nick_new (t_irc_server *, t_irc_channel *, char *,
|
||||
int, int, int, int, int);
|
||||
extern void nick_resort (t_irc_channel *, t_irc_nick *);
|
||||
extern void nick_change (t_irc_channel *, t_irc_nick *, char *);
|
||||
extern void nick_free (t_irc_channel *, t_irc_nick *);
|
||||
@@ -364,28 +383,28 @@ extern void dcc_close (t_irc_dcc *, int);
|
||||
extern void dcc_accept (t_irc_dcc *);
|
||||
extern void dcc_accept_resume (t_irc_server *, char *, int, unsigned long);
|
||||
extern void dcc_start_resume (t_irc_server *, char *, int, unsigned long);
|
||||
extern t_irc_dcc *dcc_alloc ();
|
||||
extern t_irc_dcc *dcc_add (t_irc_server *, int, unsigned long, int, char *, int,
|
||||
char *, char *, unsigned long);
|
||||
extern void dcc_send_request (t_irc_server *, int, char *, char *);
|
||||
extern void dcc_chat_sendf (t_irc_dcc *, char *, ...);
|
||||
extern void dcc_handle ();
|
||||
extern void dcc_end ();
|
||||
extern void dcc_print_log (t_irc_dcc *);
|
||||
|
||||
/* IRC display (irc-diplay.c) */
|
||||
|
||||
extern void irc_display_prefix (t_irc_server *, t_gui_buffer *, char *);
|
||||
extern void irc_display_nick (t_gui_buffer *, t_irc_nick *, char *, int,
|
||||
int, int, int);
|
||||
extern void irc_display_away (t_irc_server *, char *, char *);
|
||||
extern void irc_display_mode (t_irc_server *, t_gui_buffer *, char *, char,
|
||||
char *, char *, char *, char *);
|
||||
extern void irc_display_server (t_irc_server *ptr_server);
|
||||
|
||||
/* IRC protocol (irc-commands.c) */
|
||||
/* IRC commands issued by user (irc-send.c) */
|
||||
|
||||
extern int irc_is_highlight (char *, char *);
|
||||
extern int irc_recv_command (t_irc_server *, char *, char *, char *, char *);
|
||||
extern void irc_login (t_irc_server *);
|
||||
/* IRC commands issued by user */
|
||||
extern int irc_cmd_send_admin (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_ame (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_amsg (t_irc_server *, char *);
|
||||
@@ -445,7 +464,11 @@ extern int irc_cmd_send_wallops (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_who (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_whois (t_irc_server *, char *);
|
||||
extern int irc_cmd_send_whowas (t_irc_server *, char *);
|
||||
/* IRC commands executed when received from server */
|
||||
|
||||
/* IRC commands executed when received from server (irc-recv.c) */
|
||||
|
||||
extern int irc_is_highlight (char *, char *);
|
||||
extern int irc_recv_command (t_irc_server *, char *, char *, char *, char *);
|
||||
extern int irc_cmd_recv_error (t_irc_server *, char *, char *, char *);
|
||||
extern int irc_cmd_recv_invite (t_irc_server *, char *, char *, char *);
|
||||
extern int irc_cmd_recv_join (t_irc_server *, char *, char *, char *);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2003-2005 FlashCode <flashcode@flashtux.org>
|
||||
# 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
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user