Merges from Irssi CVS.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 7 May 2002 17:53:31 +0000 (17:53 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 7 May 2002 17:53:31 +0000 (17:53 +0000)
67 files changed:
CHANGES
apps/irssi/autogen.sh
apps/irssi/configure.in
apps/irssi/default.theme
apps/irssi/docs/crash.txt
apps/irssi/docs/formats.txt
apps/irssi/docs/help/in/hilight.in
apps/irssi/docs/help/in/levels.in
apps/irssi/docs/manual.txt
apps/irssi/docs/perl.txt
apps/irssi/docs/signals.txt
apps/irssi/docs/startup-HOWTO.html
apps/irssi/silc.conf
apps/irssi/src/common.h
apps/irssi/src/core/channels.c
apps/irssi/src/core/commands.c
apps/irssi/src/core/commands.h
apps/irssi/src/core/expandos.c
apps/irssi/src/core/masks.c
apps/irssi/src/core/queries.c
apps/irssi/src/core/servers-reconnect.c
apps/irssi/src/core/servers.c
apps/irssi/src/core/session.c
apps/irssi/src/core/signals.c
apps/irssi/src/core/signals.h
apps/irssi/src/core/special-vars.c
apps/irssi/src/fe-common/core/chat-completion.c
apps/irssi/src/fe-common/core/completion.c
apps/irssi/src/fe-common/core/fe-channels.c
apps/irssi/src/fe-common/core/fe-common-core.c
apps/irssi/src/fe-common/core/fe-exec.c
apps/irssi/src/fe-common/core/fe-exec.h
apps/irssi/src/fe-common/core/fe-messages.c
apps/irssi/src/fe-common/core/fe-queries.c
apps/irssi/src/fe-common/core/fe-windows.c
apps/irssi/src/fe-common/core/formats.c
apps/irssi/src/fe-common/core/formats.h
apps/irssi/src/fe-common/core/keyboard.c
apps/irssi/src/fe-common/core/keyboard.h
apps/irssi/src/fe-common/core/module-formats.c
apps/irssi/src/fe-common/core/module-formats.h
apps/irssi/src/fe-common/core/window-commands.c
apps/irssi/src/fe-common/core/windows-layout.c
apps/irssi/src/fe-text/gui-printtext.c
apps/irssi/src/fe-text/gui-readline.c
apps/irssi/src/fe-text/module-formats.c
apps/irssi/src/fe-text/statusbar.c
apps/irssi/src/fe-text/term-terminfo.c
apps/irssi/src/fe-text/textbuffer-reformat.c
apps/irssi/src/perl/common/Core.xs
apps/irssi/src/perl/common/Irssi.pm
apps/irssi/src/perl/module-formats.c
apps/irssi/src/perl/perl-common.c
apps/irssi/src/perl/perl-signals-list.h
apps/irssi/src/perl/perl-signals.c
apps/irssi/src/perl/perl-signals.h
apps/irssi/src/perl/ui/Formats.xs
apps/irssi/src/perl/ui/Themes.xs
apps/irssi/src/silc/core/silc-channels.c
apps/irssi/src/silc/core/silc-core.c
doc/Makefile.am.pre
doc/draft-riikonen-silc-commands-03.nroff
doc/draft-riikonen-silc-flags-payloads-00.nroff
doc/draft-riikonen-silc-ke-auth-05.nroff
doc/draft-riikonen-silc-pp-05.nroff
doc/draft-riikonen-silc-spec-05.nroff
prepare

diff --git a/CHANGES b/CHANGES
index 11aede39025c01fee07f31b7bb585892ca7cb4c5..1d0a8464c29f973546aa16e2f4840530c207f0af 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+Tue May  7 20:41:58 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+       * Merged with Irssi CVS for Irssi SILC client.
+
 Tue May  7 11:07:16 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
 
        * Added the founder's public key delivery to the
index 5ad69a2724375d696038fbb29bc27b8967ea7a45..791563091a22f919f76d695365e8e3195b4abcc8 100755 (executable)
@@ -88,14 +88,34 @@ xlc )
   am_opt=--include-deps;;
 esac
 
-rm -f aclocal.m4
+rm -f aclocal.m4 glib.m4 glib-2.0.m4
 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
   echo "Running libtoolize..."
   libtoolize --force --copy
 fi
 aclocalinclude="$ACLOCAL_FLAGS -I ."
 echo "Running aclocal $aclocalinclude ..."
+
+# see if we don't have glib.m4 or glib-2.0.m4 there yet
+error=`aclocal $aclocalinclude 2>&1`
+if test "x`echo $error|grep 'AM_PATH_GLIB[^_]'`" != "x"; then
+  cp glib.m4_ glib.m4
+  error=`aclocal $aclocalinclude 2>&1`
+fi
+if test "x`echo $error|grep AM_PATH_GLIB_2_0`" != "x"; then
+  cp glib-2.0.m4_ glib-2.0.m4
+fi
+
 aclocal $aclocalinclude
+
+# aclocal for some reason doesn't complain about glib2, so we still need
+# to check it later again..
+if grep "^AC_DEFUN.AM_PATH_GLIB_2_0" aclocal.m4 >/dev/null; then :;
+else
+  cp glib-2.0.m4_ glib-2.0.m4
+  aclocal $aclocalinclude
+fi
+
 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
   echo "Running autoheader..."
   autoheader
index 2031de73ef57cb8480fe8d19dc84cc00592ec0e1..c039ddbe6a2da501bca46d11c789a781468d7bb5 100644 (file)
@@ -110,6 +110,19 @@ if test "x$prefix" != "xNONE"; then
        perl_prefix_note=yes
 fi
 
+AC_ARG_WITH(tests,
+[  --with-glib2           Use GLIB 2.0 instead of 1.2],
+       if test x$withval = xyes; then
+               want_glib2=yes
+       else
+               if test "x$withval" = xno; then
+                       want_glib2=no
+               else
+                       want_glib2=yes
+               fi
+       fi,
+       want_glib2=yes)
+
 AC_ARG_WITH(perl-staticlib,
 [  --with-perl-staticlib   Specify that we want to link perl libraries
                         statically in irssi, default is no],
@@ -311,16 +324,36 @@ AC_DEFUN(AC_CHECK_GLIBDIR,[
 AC_CHECK_GLIBDIR
 
 if test -z "$GLIB_DIR"; then
-  AM_PATH_GLIB(1.2.0,,, gmodule)
-  if test -z "$GLIB_LIBS"; then
-    echo "*** trying without -lgmodule"
-    glib_config_args=
-    AM_PATH_GLIB(1.2.0)
+  if test "x$with_glib2" = "xyes"; then
+    dnl * check only for glib2
+    checks="3 4"
   else
-    AC_DEFINE(HAVE_GMODULE)
-    have_gmodule=yes
+    dnl * check glib1 then glib2
+    checks="1 2 3 4"
   fi
 
+  for try in $checks; do
+    glib_config_args=
+    if test $try = 1 -o $try = 3; then
+      glib_modules=gmodule
+    else
+      echo "*** trying without -lgmodule"
+      glib_modules=
+    fi
+    if test $try = 1 -o $try = 2; then
+      AM_PATH_GLIB(1.2.0,,, $glib_modules)
+    else
+      AM_PATH_GLIB_2_0(2.0.0,,, $glib_modules)
+    fi
+    if test "$GLIB_LIBS"; then
+      if test $glib_modules = gmodule; then
+        AC_DEFINE(HAVE_GMODULE)
+        have_gmodule=yes
+      fi
+      break
+    fi
+  done
+
   if test -z "$GLIB_LIBS"; then
     echo
     echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org"
@@ -448,9 +481,8 @@ if test "x$want_textui" = "xyes"; then
                  LIBS="$LIBS -ltermcap"
                  want_termcap=yes
                ], [
-                 AC_MSG_WARN(Terminfo/termcap not found)
+                 AC_ERROR(Terminfo/termcap not found - install ncurses-devel package)
                  want_textui=no
-                 curses_error=yes
                ])))
         fi
                if test "x$want_termcap" = "xyes"; then
@@ -535,21 +567,14 @@ if test "$want_perl" != "no"; then
                esac
 
                dnl * check that perl's ldflags actually work
-               AC_CACHE_VAL(irssi_cv_lib_perl_works, [
-                       echo "main(){perl_alloc(); return 0;}" > conftest.c
-                       $CC $CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> perl.error.tmp > /dev/null
-                       if test -s conftest; then
-                               irssi_cv_lib_perl_works=yes
-                       else
-                               irssi_cv_lib_perl_works=no
-                       fi
-               ])
-
-               if test "x$irssi_cv_lib_perl_works" = "xno"; then
+               echo "main(){perl_alloc(); return 0;}" > conftest.c
+               $CC $CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> perl.error.tmp > /dev/null
+               if test ! -s conftest; then
                        perl_check_error="Error linking with perl libraries: $PERL_LDFLAGS: `cat perl.error.tmp`"
                        AC_MSG_RESULT([error linking with perl libraries, building without Perl])
                        want_perl=no
                fi
+
                rm -f perl.error.tmp
        fi
 
@@ -798,23 +823,16 @@ fi
 
 echo
 
-if test "x$curses_error" != "xyes"; then
-       if test "x$want_textui" = "xno"; then
-               text=no
-       elif test "x$want_termcap" = "xyes"; then
-               text="yes, using termcap"
-       elif test "x$want_terminfo" = "xyes"; then
-               text="yes, using terminfo"
-       else
-               text="yes, using curses"
-       fi
-       echo "Building text frontend ..... : $text"
+if test "x$want_textui" = "xno"; then
+       text=no
+elif test "x$want_termcap" = "xyes"; then
+       text="yes, using termcap"
+elif test "x$want_terminfo" = "xyes"; then
+       text="yes, using terminfo"
 else
-       echo "Building text frontend ..... : NO!!"
-       echo " - Because curses was not found, specify the path to it with"
-       echo "   --with-curses=/dir and make sure you have the curses headers"
-       echo "   installed (usually in ncurses-devel package)"
+       text="yes, using curses"
 fi
+echo "Building text frontend ..... : $text"
 echo "Building irssi bot ......... : $want_irssibot"
 echo "Building irssi proxy ....... : $want_irssiproxy"
 echo "Building with IPv6 support . : $want_ipv6"
@@ -843,6 +861,10 @@ if test "x$want_perl" != "xno" -a "x$perl_mod_error" != "x"; then
        echo " - NOTE: Perl support will be compiled statically to irssi, not as"
        echo "   a module as requested. Reason:"
        echo "   $perl_mod_error"
+
+       if test -f /etc/debian_version; then
+               echo " - Try: apt-get install libperl-dev"
+       fi
 fi
 
 if test "x$want_perl" != "xno"; then
@@ -863,3 +885,5 @@ fi
 
 echo "Install prefix ............. : $prefix"
 
+echo
+echo "If there was any problems, read the INSTALL file."
index 584856c8ce693feb385115cb997a9c7626f4afe8..121ca9459dc4538caa2cc2aea1f4b3d52d958286 100644 (file)
 #############################################################################
 
 # default foreground color (%N) - 0 is the "default terminal color" 
-default_color = 0;
+default_color = "-1";
 
-# default foreground color when "0" can't be used,
-# such as with bolds and reverses. white is default.
-default_real_color = 7;
+# print timestamp/servertag at the end of line, not at beginning
+info_eol = "false";
 
 # these characters are automatically replaced with specified color
 # (dark grey by default)
-replaces = {};
+replaces = { "()=" = "%K$*%n"; };
+#replaces = {};
 
 abstracts = {
   ##
index d3100f573aef7e913c830de6d92a1cff290b293e..5461b9bf2c3b8d4ada85f39e7aeb9ac4391a9e9e 100644 (file)
@@ -1,5 +1,7 @@
 How to submit a good bug report?
 
+Send them to bugs@irssi.org.
+
 First you should give the following information:
  - irssi version, if CVS (or devel. tarball) then which day?
  - operating system / distribution and it's version
index e98f2719e7feb0a1a2297939a6195cb8e84fe18d..d918a26890e2c0cdd2dd733406693436a3e8bee9 100644 (file)
@@ -3,7 +3,7 @@
 
                            text            text            background
    ---------------------------------------------------------------------
-   %k      %K      %0      black           bold black      black
+   %k      %K      %0      black           dark grey       black
    %r      %R      %1      red             bold red        red
    %g      %G      %2      green           bold green      green
    %y      %Y      %3      yellow          bold yellow     yellow
@@ -19,6 +19,7 @@
    %9      %_              Bold on/off
    %:                      Insert newline
    %|                      Marks the indentation position
+   %#                      Monospace font on/off (useful with lists and GUI)
    %%                      A single %
 
  In .theme files %n works a bit differently. See default.theme
index a38d10c9a1ef4985a386185e74c662b59423ccc1..58d1d118d248b7d7f3c33be7ce35a8818bd8ca0a 100644 (file)
@@ -7,8 +7,9 @@
    -nick: Hilight only the nick, not the whole line (default)
    -word: Hilight only the word (default with non-public messages)
    -line: Hilight the whole line with the hilight color.
-   -color: Print the message with <color>. color is in %code format
+   -color: Print the message with <color>. color is in %%code format
            (see docs/formats.txt)
+   -actcolor: Color to show in statusbar activity, or don't change if %%n.
    -level: Match only for <level> messages, default is
            publics,msgs,notices,actions
    -channels: Match only in <channels>
@@ -19,7 +20,7 @@ Hilight lines that have "mynick" word:
   /HILIGHT mynick
 
 Hilight lines that were written by nicks from *.fi with bold green
-  /HILIGHT -color %G -mask *!*@*.fi
+  /HILIGHT -color %%G -mask *!*@*.fi
 
 For regular expressions, see `man 7 regex`.
 
index e48a79fd40ecd6f9690030006e941ebf69828521..b6ebed7ef807c4c074939d29a86ca1a7ce97ffd5 100644 (file)
@@ -11,7 +11,7 @@ list of them all:
     ACTIONS         - Actions (/me) - usually ORed with PUBLIC or MSGS
     JOINS           - Someone joins a channel
     PARTS           - Someone parts a channel
-    QUITS           - Someone quits network
+    QUITS           - Someone quits IRC
     KICKS           - Someone gets kicked from channel
     MODES           - Channel mode is changed
     TOPICS          - Channel topic is changed
@@ -20,8 +20,8 @@ list of them all:
     NICKS           - Someone changes nick
     DCC             - DCC related messages
     DCCMSGS         - DCC chat messages
-    CLIENTNOTICES   - Irssi's notices
-    CLIENTERRORS    - Irssi's error messages
+    CLIENTNOTICE    - Irssi's notices
+    CLIENTERROR     - Irssi's error messages
     CLIENTCRAP      - Some other messages from Irssi
 
 And a few special ones that could be included with the
index 2954deff23d114adb1ca5ad9510f646c2fcce889..2956e18e1b23d82e67a756f7fcdb2801d471b9da 100644 (file)
@@ -1,7 +1,7 @@
 
  Irssi 0.8 documentation - http://irssi.org/
 
- Copyright(c) 2000 Timo Sirainen <tss@iki.fi>
+ Copyright(c) 2000 Timo Sirainen <cras@irssi.org>
 
 
  Index
index 23ecfbed1f520ce193f9aeab56e8d2570b0e3424..59c7e57a14f5a757082aafa915b35ba3e6e369ae 100644 (file)
@@ -958,12 +958,6 @@ Server::channel_create(name, automatic)
 Channel::bans()
   Return a list of bans in channel.
 
-Channel::ebans()
-  Return a list of ban exceptions in channel.
-
-Channel::invites()
-  Return invite list (+I) of channel.
-
 Channel::ban_get_mask(nick)
   Get ban mask for `nick'.
 
@@ -973,22 +967,6 @@ Channel::banlist_add(ban, nick, time)
 Channel::banlist_remove(ban)
    Remove a ban from channel.
 
-Channel::banlist_exception_add(ban, nick, time)
-   Add a new ban exception to channel.
-
-Channel::banlist_exception_remove(ban)
-   Remove a ban exception from channel.
-
-Channel::invitelist_add(mask)
-   Add a new invite mask to channel.
-
-Channel::invitelist_remove(mask)
-   Remove invite mask from channel.
-
-modes_join(old, mode, channel)
-  Add `mode' to `old' - return newly allocated mode. If `channel' is 1,
-  we're parsing channel mode and we should try to join mode arguments too.
-
 
  *** DCC
 
index f009a4deb3c481187cddb9606a63b67cccc2e00b..2bf0d9213105238597826963ed856b6ada2b618d 100644 (file)
@@ -70,6 +70,7 @@ queries.c:
  "query created", QUERY_REC, int automatic
  "query destroyed", QUERY_REC
  "query nick changed", QUERY_REC, char *orignick
+ "window item name changed", WI_ITEM_REC
  "query address changed", QUERY_REC
  "query server changed", QUERY_REC, SERVER_REC
 
@@ -151,8 +152,8 @@ mode-lists.c:
  "ban remove", CHANNEL_REC, BAN_REC
 
 modes.c:
- "channel mode changed", CHANNEL_REC
- "nick mode changed", CHANNEL_REC, NICK_REC
+ "channel mode changed", CHANNEL_REC, char *setby
+ "nick mode changed", CHANNEL_REC, NICK_REC, char *setby
  "user mode changed", SERVER_REC, char *old
  "away mode changed", SERVER_REC
 
@@ -225,7 +226,7 @@ FE common
 
 * Requires to work properly:
 
- "gui print text", WINDOW_REC, int fg, int bg, int flags, char *text, int level
+ "gui print text", WINDOW_REC, int fg, int bg, int flags, char *text, TEXT_DEST_REC
 
 (Can be used to determine when all "gui print text"s are sent (not required))
  "gui print text finished", WINDOW_REC
@@ -304,6 +305,9 @@ fe-irc-messages.c:
  "message irc own_ctcp", SERVER_REC, char *cmd, char *data, char *target
  "message irc ctcp", SERVER_REC, char *cmd, char *data, char *nick, char *address, char *target
 
+fe-modes.c:
+ "message irc mode", SERVER_REC, char *channel, char *nick, char *addr, char *mode
+
 dcc/fe-dcc-chat-messages.c:
  "message dcc own", DCC_REC *dcc, char *msg
  "message dcc own_action", DCC_REC *dcc, char *msg
index cb323cda120f3650bf5d213e03a755bd6450fbfd..5700d9f021e132bace66bef76e39633744600264 100644 (file)
@@ -8,18 +8,21 @@
 <p>Index with some FAQ questions that are answered in the chapter:</p>
 
 <ol>
-<li><a href="#c1">For all the lazy people</a></li>
+<li><a href="#c1">For all the lazy people</a>
     <ul>
     <li>This window management is just weird, I want it exactly like ircII</li>
-    </ul>
+    </ul></li>
 <li><a href="#c2">Basic user interface usage</a>
     <ul>
     <li>Split windows work in weird way</li>
+    <li>How can I easily switch between windows?</li>
+    <li>But alt-1 etc. don't work!</li>
     </ul></li>
 <li><a href="#c3">Server and channel automation</a>
     <ul>
     <li>How do I automatically connect to servers at startup?</li>
     <li>How do I automatically join to channels at startup?</li>
+    <li>How do I automatically send commands to server at connect?</li>
     </ul></li>
 <li><a href="#c4">Setting up windows and automatically restoring them
     at startup</a></li>
@@ -77,8 +80,8 @@ like msgs window where all messages go:</p>
      /SET use_msgs_window ON
 </pre>
 
-<p>Disable automatic window closing when /PARTing channel or /UNQUERYing
-query:</p>
+<p>Disable automatic window closing when <code>/PART</code>ing channel or
+<code>/UNQUERY</code>ing query:</p>
 
 <pre>
      /SET autoclose_windows OFF
@@ -139,11 +142,11 @@ If you want lines containing your nick to hilight:
 
 <p>Windows can be scrolled up/down with PgUp and PgDown keys. If they don't
 work for you, use Meta-p and Meta-n keys. For jumping to beginning or end of
-the buffer, use /SB HOME and /SB END commands.</p>
+the buffer, use <code>/SB HOME</code> and <code>/SB END</code> commands.</p>
 
-<p>By default, irssi uses "hidden windows" for everything. Hidden
-window is created every time you /JOIN a channel or /QUERY someone.
-There's several ways you can change between these windows:</p>
+<p>By default, irssi uses "hidden windows" for everything. Hidden window is
+created every time you <code>/JOIN</code> a channel or <code>/QUERY</code>
+someone. There's several ways you can change between these windows:</p>
 
 <pre>
      Meta-1, Meta-2, .. Meta-0 - Jump directly between windows 1-10
@@ -176,11 +179,12 @@ want to use ALT instead of Windows key for it, use:</p>
 </pre>
 
 <p>And how exactly do you set these X resources? For Debian, there's
-/etc/X11/Xresources/xterm file where you can put them and it's read 
-automatically when X starts. ~/.Xresources and ~/.Xdefaults files might also
-work. If you can't get anything else to work, just copy&amp;paste those lines to
-~/.Xresources and directly call "xrdb -merge ~/.Xresources" in some xterm.  
-The resources affect only the new xterms you start, not existing ones.</p>  
+<code>/etc/X11/Xresources/xterm</code> file where you can put them and it's
+read automatically when X starts. <code>~/.Xresources</code> and 
+<code>~/.Xdefaults</code> files might also work. If you can't get anything
+else to work, just copy and paste those lines to <code>~/.Xresources</code>
+and directly call <code>xrdb -merge ~/.Xresources</code> in some xterm. 
+The resources affect only the new xterms you start, not existing ones.</p> 
 
 <p>Many windows SSH clients also don't allow usage of ALT. One excellent
 client that does allow is putty, you can download it from
@@ -260,11 +264,16 @@ helps with reconnecting if your primary server breaks and is probably
 useful in some other ways too :) For information how to actually use
 irssi correctly with multiple servers see the chapter 6.</p>
 
-<p>First you need to have your IRC network set, use /IRCNET command to
-see if it's already there. If it isn't, use /IRCNET ADD yourircnet. To
-make Irssi work properly with different IRC networks, you might need to
-give some special settings to /IRCNET ADD, see manual.txt for more
-information about them. Irssi defaults to IRCNet's behaviour.</p>
+<p>First you need to have your IRC network set, use <code>/IRCNET</code>
+command to see if it's already there. If it isn't, use <code>/IRCNET ADD
+yourircnet</code>. If you want to execute some commands automatically when
+you're connected to some network, use <code>-autosendcmd</code> option.
+Here's some examples:</p>
+
+<pre>
+     /IRCNET ADD -autosendcmd '^msg bot invite' ircnet
+     /IRCNET ADD -autosendcmd "/^msg nickserv ident pass;wait -opn 2000" opn
+</pre>
 
 <p>After that you need to add your servers. For example:</p>
 
@@ -273,10 +282,11 @@ information about them. Irssi defaults to IRCNet's behaviour.</p>
      /SERVER ADD -auto -ircnet worknet irc.mycompany.com 6667 password
 </pre>
 
-<p>The -auto option specifies that this server is automatically connected
-at startup. You don't need to make more than one server with -auto
-option to one IRC network, other servers are automatically connected in
-same network if the -auto server fails.</p>
+<p>The <code>-auto</code> option specifies that this server is
+automatically connected at startup. You don't need to make more than one
+server with <code>-auto</code> option to one IRC network, other servers are
+automatically connected in same network if the <code>-auto</code> server
+fails.</p>
 
 <p>And finally channels:</p>
 
@@ -286,15 +296,15 @@ same network if the -auto server fails.</p>
      /CHANNEL ADD -auto #secret ircnet password
 </pre>
 
-<p>-bots and -botcmd should be the only ones needing a bit of
-explaining. They're used to send commands automatically to bot when
-channel is joined, usually to get ops automatically. You can specify
-multiple bot masks with -bots option separated with spaces (and
-remember to quote the string then). The $0 in -botcmd specifies the
-first found bot in the list. If you don't need the bot masks (ie. the
-bot is always with the same nick, like chanserv) you can give only the
--botcmd option and the command is always sent.</p>
-
+<p><code>-bots</code> and <code>-botcmd</code> should be the only ones
+needing a bit of explaining. They're used to send commands automatically to
+bot when channel is joined, usually to get ops automatically. You can
+specify multiple bot masks with <code>-bots</code> option separated with
+spaces (and remember to quote the string then). The $0 in
+<code>-botcmd</code> specifies the first found bot in the list. If you
+don't need the bot masks (ie. the bot is always with the same nick, like
+chanserv) you can give only the <code>-botcmd</code> option and the command
+is always sent.</p>
 
 <h3><a id="c4">4. Setting up windows and automatically restoring them at startup</a></h3>
 
@@ -307,17 +317,18 @@ use commands:</p>
      /WINDOW ITEM MOVE &lt;number&gt;|&lt;name&gt; - move channel/query to another window
 </pre>
 
-<p>When everything looks the way you like, use /LAYOUT SAVE command
-(and /SAVE, if you don't have autosaving enabled) and when you start
-irssi next time, irssi remembers the positions of the channels, queries
-and everything. This "remembering" doesn't mean that simply using
-/LAYOUT SAVE would automatically make irssi reconnect to all servers
-and join all channels, you'll need the /SERVER ADD -auto and /CHANNEL
-ADD -auto commands to do that.</p>
+<p>When everything looks the way you like, use <code>/LAYOUT SAVE</code>
+command (and <code>/SAVE</code>, if you don't have autosaving enabled) and
+when you start irssi next time, irssi remembers the positions of the
+channels, queries and everything. This "remembering" doesn't mean that
+simply using <code>/LAYOUT SAVE</code> would automatically make irssi
+reconnect to all servers and join all channels, you'll need the
+<code>/SERVER ADD -auto</code> and <code>/CHANNEL ADD -auto</code> commands
+to do that.</p>
 
 <p>If you want to change the layout, you just rearrange the layout like
-you want it and use /LAYOUT SAVE again. If you want to remove the
-layout for some reason, use /LAYOUT RESET.</p>
+you want it and use <code>/LAYOUT SAVE</code> again. If you want to remove
+the layout for some reason, use <code>/LAYOUT RESET.</code></p>
 
 
 <h3><a id="c5">5. Status and msgs windows &amp; message levels</a></h3>
@@ -331,7 +342,7 @@ query. Some people like it, some don't. If you want to remove it, use</p>
 </pre>
 
 <p>This doesn't have any effect until you restart irssi. If you want to
-remove it immediately, just /WINDOW CLOSE it.</p>
+remove it immediately, just <code>/WINDOW CLOSE</code> it.</p>
 
 <p>Another common window is "messages window", where all private
 messages go. By default it's disabled and query windows are created
@@ -354,7 +365,7 @@ irssi. To create it immediately say:</p>
 </pre>
 
 <p>Note that neither use_msgs_window nor use_status_window have any
-effect at all if /LAYOUT SAVE has been used.</p>
+effect at all if <code>/LAYOUT SAVE</code> has been used.</p>
 
 <p>This brings us to message levels.. What are they? All messages that
 irssi prints have one or more "message levels". Most common are PUBLIC
@@ -366,10 +377,10 @@ list of levels with</p>
      /HELP levels
 </pre>
 
-<p>Status window has message level "ALL -MSGS", meaning that all messages,
-except private messages, without more specific place go to status
-window. The -MSGS is there so it doesn't conflict with messages
-window.</p>
+<p>Status window has message level <code>ALL -MSGS</code>, meaning that all
+messages, except private messages, without more specific place go to status
+window. The <code>-MSGS</code> is there so it doesn't conflict with
+messages window.</p>
 
 
 <h3><a id="c6">6. How support for multiple servers works in irssi</a></h3>
@@ -385,9 +396,9 @@ how you do connect to new server without closing the old connection:</p>
      /CONNECT irc.server.org
 </pre>
 
-<p>Instead of the /SERVER which disconnects the existing connection. To
-see list of all active connections, use /SERVER without any parameters.
-You should see a list of something like:</p>
+<p>Instead of the <code>/SERVER</code> which disconnects the existing
+connection. To see list of all active connections, use <code>/SERVER</code>
+without any parameters. You should see a list of something like:</p>
 
 <pre>
      -!- IRCNet: irc.song.fi:6667 (IRCNet)
@@ -404,9 +415,9 @@ When there's multiple connections to same IRC network or server, irssi
 adds a number after the tag so there could be ircnet, ircnet2, ircnet3
 etc.</p>
 
-<p>Server tags beginning with RECON- mean server reconnections. Above we
-see that connection to server at 192.168.0.1 wasn't successful and
-irssi will try to connect it again in 3 minutes.</p>
+<p>Server tags beginning with <code>RECON-</code> mean server
+reconnections. Above we see that connection to server at 192.168.0.1 wasn't
+successful and irssi will try to connect it again in 3 minutes.</p>
 
 <p>To disconnect one of the servers, or to stop irssi from
 reconnecting, use</p>
@@ -436,8 +447,8 @@ multiple connected servers, irssi adds [servertag] prefix to all
 messages in non-channel/query messages so you'll know where it came
 from.</p>
 
-<p>Several commands also accept -servertag option to specify which server
-it should use:</p>
+<p>Several commands also accept <code>-servertag</code> option to specify
+which server it should use:</p>
 
 <pre>
      /MSG -tag nick message
@@ -445,8 +456,8 @@ it should use:</p>
      /QUERY -tag nick
 </pre>
 
-<p>/MSG tab completion also automatically adds the -tag option when
-nick isn't in active server.</p>
+<p><code>/MSG</code> tab completion also automatically adds the
+<code>-tag</code> option when nick isn't in active server.</p>
 
 <p>Window's server can be made sticky. When sticky, it will never
 automatically change to anything else, and if server gets disconnected, the
@@ -475,8 +486,8 @@ for each server. Here's how to do them (repeat for each server)</p>
 
 <h3><a id="c7">7. /LASTLOG and jumping around in scrollback</a></h3>
 
-<p>/LASTLOG command can be used for searching texts in scrollback
-buffer. Simplest usages are</p>
+<p><code>/LASTLOG</code> command can be used for searching texts in
+scrollback buffer. Simplest usages are</p>
 
 <pre>
      /LASTLOG word     - print all lines with "word" in them
@@ -485,30 +496,32 @@ buffer. Simplest usages are</p>
 </pre>
 
 <p>If there's more than 1000 lines to be printed, irssi thinks that you
-probably made some mistake and won't print them without -force option.
-If you want to save the full lastlog to file, use</p>
+probably made some mistake and won't print them without <code>-force</code>
+option. If you want to save the full lastlog to file, use</p>
 
 <pre>
      /LASTLOG -file ~/irc.log
 </pre>
 
-<p>With -file option you don't need -force even if there's more than 1000
-lines. /LASTLOG has a lot of other options too, see /HELP lastlog for
-details.</p>
+<p>With <code>-file</code> option you don't need <code>-force</code> even
+if there's more than 1000 lines. <code>/LASTLOG</code> has a lot of other
+options too, see <code>/HELP lastlog</code> for details.</p>
 
 <p>Once you've found the lines you were interested in, you might want
-to check the discussion around them. Irssi has /SCROLLBACK (or alias
-/SB) command for jumping around in scrollback buffer. Since /LASTLOG
-prints the timestamp when the message was originally printed, you can
-use /SB GOTO hh:mm to jump directly there. To get back to the bottom of
-scrollback, use /SB END command.</p>
+to check the discussion around them. Irssi has <code>/SCROLLBACK</code> (or
+alias <code>/SB</code>) command for jumping around in scrollback buffer.
+Since <code>/LASTLOG</code> prints the timestamp when the message was
+originally printed, you can use <code>/SB GOTO hh:mm</code> to jump
+directly there. To get back to the bottom of scrollback, use <code>/SB
+END</code> command.</p>
 
 
 <h3><a id="c8">8. Logging</a></h3>
 
 <p>Irssi can automatically log important messages when you're set away
-(/AWAY reason). When you set yourself unaway (/AWAY), the new messages
-in away log are printed to screen. You can configure it with:</p>
+(<code>/AWAY reason</code>). When you set yourself unaway
+(<code>/AWAY</code>), the new messages in away log are printed to screen.
+You can configure it with:</p>
 
 <pre>
      /SET awaylog_level MSGS HILIGHT     - Specifies what messages to log
@@ -524,7 +537,8 @@ You can turn it on with</p>
 </pre>
 
 <p>By default it logs pretty much everything execept CTCPS or CRAP
-(/WHOIS requests, etc). You can specify the logging level yourself with</p>
+(<code>/WHOIS</code> requests, etc). You can specify the logging level
+yourself with</p>
 
 <pre>
      /SET autolog_level ALL -CRAP -CLIENTCRAP -CTCPS (this is the default)
@@ -546,7 +560,8 @@ logs by adding date/time formats to the file name. The formats are in
      /SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log
 </pre>
 
-<p>For logging only some specific channels or nicks, see /HELP log</p>
+<p>For logging only some specific channels or nicks, see <code>/HELP
+log</code></p>
 
 
 <h3><a id="c9">9. Changing keyboard bindings</a></h3>
@@ -556,33 +571,34 @@ about. It doesn't let irssi know everything, so for example
 shift-backspace can't be bound unless you modify xterm resources
 somehow.</p>
 
-<p>/HELP bind tells pretty much everything there is to know about
-keyboard bindings. However, there's the problem of how to bind some
-non-standard keys. They might differ a bit with each terminal, so
-you'll need to find out what exactly the keypress produces. Easiest
-way to check that would be to see what it prints in "cat". Here's
-an example for pressing F1 key:</p>
+<p><code>/HELP bind</code> tells pretty much everything there is to know
+about keyboard bindings. However, there's the problem of how to bind some
+non-standard keys. They might differ a bit with each terminal, so you'll
+need to find out what exactly the keypress produces. Easiest way to check
+that would be to see what it prints in <code>cat</code>. Here's an example
+for pressing F1 key:</p>
 
 <pre>
-[cras@hurina] ~% cat
-^[OP
+     [cras@hurina] ~% cat
+     ^[OP
 </pre>
 
-<p>So in irssi you would use /BIND ^[OP /ECHO F1 pressed. If you use
-multiple terminals which have different bindings for the key, it would
-be better to use eg.:</p>
+<p>So in irssi you would use <code>/BIND ^[OP /ECHO F1</code> pressed. If
+you use multiple terminals which have different bindings for the key, it
+would be better to use eg.:</p>
 
 <pre>
-/BIND ^[OP key F1
-/BIND ^[11~ key F1
-/BIND F1 /ECHO F1 pressed.
+     /BIND ^[OP key F1
+     /BIND ^[11~ key F1
+     /BIND F1 /ECHO F1 pressed.
 </pre>
 
 <h3><a id="c10">10. Proxies and IRC bouncers</a></h3>
 
 <p>Irssi supports connecting to IRC servers via a proxy. All server
 connections are then made through it, and if you've set up everything
-properly, you don't need to do any /QUOTE SERVER commands manually.</p>
+properly, you don't need to do any <code>/QUOTE SERVER</code> commands
+manually.</p>
 
 <p>Here's an example: You have your bouncer (lets say, BNC or BNC-like)
 listening in irc.bouncer.org port 5000. You want to use it to connect
@@ -608,12 +624,13 @@ about them:</p>
      /SERVER ADD -auto -ircnet efnet irc.efnet.org
 </pre>
 
-<p>With the proxy /SETs however, irssi now connects to those servers
-through your BNC. All server connections are made through them so you
-can just forget that your bouncer even exists.</p>
+<p>With the proxy <code>/SET</code>s however, irssi now connects to those
+servers through your BNC. All server connections are made through them so
+you can just forget that your bouncer even exists.</p>
 
-<p>If you don't want to use the proxy for some reason, there's -noproxy
-option which you can give to /SERVER and /SERVER ADD commands.</p>
+<p>If you don't want to use the proxy for some reason, there's
+<code>-noproxy</code> option which you can give to <code>/SERVER</code> and
+<code>/SERVER ADD</code> commands.</p>
 
 <p><strong>Proxy specific settings:</strong></p>
 
@@ -677,19 +694,22 @@ as with dircproxy, by creating fake connections:</p>
     /SERVER ADD -auto -ircnet opn fake.opn 6667 opnpass
 </pre>
 
-<p>So, you'll specify the usernames with /IRCNET ADD command, and the
-user's password with /SERVER ADD.</p>
+<p>So, you'll specify the usernames with <code>/IRCNET ADD</code> command,
+and the user's password with <code>/SERVER ADD</code>.</p>
 
 <p><strong>Irssi proxy</strong></p>
 
 <p>Irssi contains it's own proxy which you can build giving
-<strong>--with-proxy</strong> option to configure. You'll still need to run
+<code>--with-proxy</code> option to configure. You'll still need to run
 irssi in a screen to use it though.</p>
 
 <p>Irssi proxy is a bit different than most proxies, normally proxies
 create a new connection to IRC server when you connect to it, but
 <strong>irssi proxy shares your existing IRC connection(s) to multiple
-clients</strong>.</p>
+clients</strong>. And even more clearly: <strong>You can use only one IRC
+server connection to IRC with as many clients as you want</strong>. Can
+anyone figure out even more easier ways to say this, so I wouldn't need to
+try to explain this thing for minutes every time? :)</p>
 
 <p>Irssi proxy supports sharing multiple server connections in different
 ports, like you can share ircnet in port 2777 and efnet in port 2778.</p>
@@ -703,9 +723,9 @@ ports, like you can share ircnet in port 2777 and efnet in port 2778.</p>
 </pre>
 
 <p><strong>NOTE</strong>: you <strong>MUST</strong> add all the servers you
-are using to server and ircnet lists with /SERVER ADD and /IRCNET ADD.
-..Except if you really don't want to for some reason, and you only use
-one server connection, you may simply set:</p>
+are using to server and ircnet lists with <code>/SERVER ADD</code> and 
+<code>/IRCNET ADD</code>. ..Except if you really don't want to for some
+reason, and you only use one server connection, you may simply set:</p>
 
 <pre>
      /SET irssiproxy_ports *=2777
@@ -714,7 +734,7 @@ one server connection, you may simply set:</p>
 <p>Usage in client side:</p>
 
 <p>Just connect to the irssi proxy like it is a normal server with password
-specified in /SET irssiproxy_password. For example:</p>
+specified in <code>/SET irssiproxy_password</code>. For example:</p>
 
 <pre>
      /SERVER ADD -ircnet ircnet my.irssi-proxy.org 2777 secret
@@ -725,9 +745,9 @@ specified in /SET irssiproxy_password. For example:</p>
 
 <p><strong>SOCKS</strong></p>
 
-Irssi can be compiled with socks support (<strong>--with-socks</strong>
-option to configure), but I don't really know how it works, if at all. /SET
-proxy settings don't have anything to do with socks however.
+Irssi can be compiled with socks support (<code>--with-socks</code> option
+to configure), but I don't really know how it works, if at all. <code>/SET
+proxy</code> settings don't have anything to do with socks however.
 
 <p><strong>Others</strong></p>
 
@@ -760,12 +780,12 @@ of them you might want to change (the default value is shown):</p>
 <dl>
 <dt>/SET autocreate_own_query ON</dt>
   <dd>Should new query window be created when you send message to someone
-  (with /msg).</dd>
+  (with <code>/MSG</code>).</dd>
 
 <dt>/SET autocreate_query_level MSGS</dt>
   <dd>New query window should be created when receiving messages with
   this level. MSGS, DCCMSGS and NOTICES levels work currently. You can
-  disable this with /SET -clear autocrate_query_level.</dd>
+  disable this with <code>/SET -clear autocrate_query_level</code>.</dd>
 
 <dt>/SET autoclose_query 0</dt>
   <dd>Query windows can be automatically closed after certain time of
@@ -785,8 +805,8 @@ of them you might want to change (the default value is shown):</p>
 <dt>/SET use_status_window ON</dt>
   <dd>Create status window at startup. All messages that don't really
   have better place go here, like all /WHOIS replies etc. Status window
-  can also be created manually with /WINDOW LEVEL ALL -MSGS, /WINDOW NAME
-  (status).</dd>
+  can also be created manually with <code>/WINDOW LEVEL ALL -MSGS</code>,
+  <code>/WINDOW NAME (status)</code>.</dd>
 
 <dt>/SET autocreate_windows ON</dt>
   <dd>Should we create new windows for new window items or just place
@@ -794,7 +814,7 @@ of them you might want to change (the default value is shown):</p>
 
 <dt>/SET autoclose_windows ON</dt>
   <dd>Should window be automatically closed when the last item in them is
-  removed (ie. /PART, /UNQUERY).</dd>
+  removed (ie. <code>/PART</code>, <code>/UNQUERY</code>).</dd>
 
 <dt>/SET reuse_unused_windows OFF</dt>
   <dd>When finding where to place new window item (channel, query) Irssi
@@ -803,16 +823,16 @@ of them you might want to change (the default value is shown):</p>
   ignored if autoclose_windows is set ON.</dd>
 
 <dt>/SET window_auto_change OFF</dt>
-  <dd>Should Irssi automatically change to automatically created windows
-  usually queries when someone sends you a message. To prevent
+  <dd>Should Irssi automatically change to automatically created windows -
+  usually queries when someone sends you a message. To prevent
   accidentally sending text meant to some other channel/nick, Irssi
   clears the input buffer when changing the window. The text is still in
   scrollback buffer, you can get it back with pressing arrow up key.</dd>
 
 <dt>/SET print_active_channel OFF</dt>
   <dd>When you keep more than one channel in same window, Irssi prints
-  the messages coming to active channel as &quot;&lt;nick&gt; text&quot;
-  and other channels as &quot;&lt;nick:channel&gt; text&quot;. If this
+  the messages coming to active channel as <code>&lt;nick&gt; text</code>
+  and other channels as <code>&lt;nick:channel&gt; text</code>. If this
   setting is set ON, the messages to active channels are also printed in
   the latter way.</dd>
 
@@ -868,11 +888,12 @@ of them you might want to change (the default value is shown):</p>
 
 <dt>/SET show_nickmode ON</dt>
   <dd>Show the nick's mode before nick in channels, ie. ops have
-  &lt;@nick&gt;, voices &lt;+nick&gt; and others &lt;&nbsp;nick&gt;</dd>
+  <code>&lt;@nick&gt;</code>, voices <code>&lt;+nick&gt;</code> and others
+  <code>&lt;&nbsp;nick&gt;</code></dd>
 
 <dt>/SET show_nickmode_empty ON</dt>
   <dd>If the nick doesn't have a mode, use one space. ie. ON:
-  &lt;&nbsp;nick&gt;, OFF: &lt;nick&gt;</dd>
+  <code>&lt;&nbsp;nick&gt;</code>, OFF: <code>&lt;nick&gt;</code></dd>
 
 <dt>/SET show_quit_once OFF</dt>
   <dd>Show quit message only once in some of the channel windows the
@@ -886,13 +907,13 @@ of them you might want to change (the default value is shown):</p>
   <dd>When lines are longer than screen width they have to be split to
   multiple lines. This specifies how much space to put at the beginning
   of the line before the text begins. This can be overridden in text
-  formats with %| format.</dd>
+  formats with <code>%|</code> format.</dd>
 
 <dt>/SET activity_hide_targets</dt>
   <dd>If you don't want to see window activity in some certain channels
-  or queries, list them here. For example "#boringchannel =bot1 =bot2".
-  If any highlighted text or message for you appears in that window, this
-  setting is ignored and the activity is shown.</dd>
+  or queries, list them here. For example <code>#boringchannel =bot1
+  =bot2</code>. If any highlighted text or message for you appears in that
+  window, this setting is ignored and the activity is shown.</dd>
 </dl>
 
 <p><strong>Nick completion</strong></p>
@@ -909,22 +930,21 @@ of them you might want to change (the default value is shown):</p>
 
 <h3><a id="c12">12. Statusbar</a></h3>
 
-<p><strong>/STATUSBAR</strong> displays a list of statusbars:</p>
+<p><code>/STATUSBAR</code> displays a list of statusbars:</p>
 
 <pre>
-Name                           Type   Placement Position Visible
-window                         window bottom    0        always
-window_inact                   window bottom    1        inactive
-prompt                         root   bottom    100      always
-topic                          root   top       1        always
+     Name                           Type   Placement Position Visible
+     window                         window bottom    0        always
+     window_inact                   window bottom    1        inactive
+     prompt                         root   bottom    100      always
+     topic                          root   top       1        always
 </pre>
 
-<p><strong>/STATUSBAR &lt;name&gt;</strong> prints the statusbar
-settings and it's items. <strong>/STATUSBAR &lt;name&gt;
-ENABLE|DISABLE</strong> enables/disables the statusbar.
-<strong>/STATUSBAR &lt;name&gt; RESET</strong> resets the statusbar to
-it's default settings, or if the statusbar was created by you, it will be
-removed.</p>
+<p><code>/STATUSBAR &lt;name&gt;</code> prints the statusbar settings and
+it's items. <code>/STATUSBAR &lt;name&gt; ENABLE|DISABLE</code>
+enables/disables the statusbar. <code>/STATUSBAR &lt;name&gt; RESET</code>
+resets the statusbar to it's default settings, or if the statusbar was
+created by you, it will be removed.</p>
 
 <p>Type can be window or root, meaning if the statusbar should be
 created for each split window, or just once. Placement can be top or
@@ -933,23 +953,23 @@ it is. Visible can be always, active or inactive. Active/inactive is
 useful only with split windows, one split window is active and the rest
 are inactive. These settings can be changed with:</p>
 
-<ul>
-<li>STATUSBAR &lt;name&gt; TYPE window|root</li>
-<li>STATUSBAR &lt;name&gt; PLACEMENT top|bottom</li>
-<li>STATUSBAR &lt;name&gt; POSITION &lt;num&gt;</li>
-<li>STATUSBAR &lt;name&gt; VISIBLE always|active|inactive</li>
-</ul>
+<pre>
+     STATUSBAR &lt;name&gt; TYPE window|root
+     STATUSBAR &lt;name&gt; PLACEMENT top|bottom
+     STATUSBAR &lt;name&gt; POSITION &lt;num&gt;
+     STATUSBAR &lt;name&gt; VISIBLE always|active|inactive
+</pre>
 
 <p>When loading a new statusbar scripts, you'll need to also specify
 where you want to show it. Statusbar items can be modified with:</p>
 
-<ul>
-<li>10:52 STATUSBAR &lt;name&gt; ADD [-before | -after &lt;item&gt;] [-priority #] [-alignment left|right] &lt;item&gt;</li>
-<li>10:52 STATUSBAR &lt;name&gt; REMOVE &lt;item&gt;</li>
-</ul>
+<pre>
+     STATUSBAR &lt;name&gt; ADD [-before | -after &lt;item&gt;] [-priority #] [-alignment left|right] &lt;item&gt;
+     STATUSBAR &lt;name&gt; REMOVE &lt;item&gt;
+</pre>
 
 <p>The item name with statusbar scripts is usually same as the script's
 name. Script's documentation should tell if this isn't the case. So, to
 add mail.pl before the window activity item (see the list with
-/STATUSBAR window), use: <strong>/STATUSBAR window ADD -before act
-mail</strong>.</p>
+<code>/STATUSBAR</code> window), use: <code>/STATUSBAR window ADD -before
+act mail</code>.</p>
index e8741573fa62039c5001892072a57bde07e8b8bb..40a078560d8db181bc4bd435a94f34afdc630ca8 100644 (file)
@@ -70,6 +70,7 @@ aliases = {
   UPTIME = "eval exec - expr `date +%s` - \\$F | awk '{print \"Irssi uptime: \"int(\\\\\\$1/3600/24)\"d \"int(\\\\\\$1/3600%24)\"h \"int(\\\\\\$1/60%60)\"m \"int(\\\\\\$1%60)\"s\" }'";
   CALC = "exec - if which bc &>/dev/null\\; then echo '$*' | bc | awk '{print \"$*=\"$$1}'\\; else echo bc was not found\\; fi";
   SBAR = "STATUSBAR";
+  Q = "QUERY";
 };
 
 #
@@ -91,6 +92,7 @@ statusbar = {
     user = "{sb $cumode$N{sbaway $A}}";
     usermode = " {sbusermode $usermode}";
     topic = " $topic";
+    topic_empty = " Irssi v$J - http://irssi.org/help/";
 
     # treated specially .. window is printed with non-empty windows,
     # window_empty is printed with empty windows
@@ -179,6 +181,7 @@ statusbar = {
       items = {
         barstart = { priority = "100"; };
         topic = { };
+        topic_empty = { };
         barend = { priority = "100"; alignment = "right"; };
       };
     };
index d6cc0421d7f296cb5d18916e707c41f2311c5213..bdfec4ec1fdaea942e0445984b66b3c298a3ca32 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __COMMON_H
 #define __COMMON_H
 
-#define IRSSI_AUTHOR "Timo Sirainen <tss@iki.fi>"
+#define IRSSI_AUTHOR "Timo Sirainen <cras@irssi.org>"
 #define IRSSI_WEBSITE "http://irssi.org/"
 
 #define IRSSI_DIR_SHORT "~/.silc"
index 06bf0c411f78c817fe8d96f5df2c3dc97dec69cd..1884c4021d86dd34585dc37e0d047c1ecba49dc8 100644 (file)
@@ -64,7 +64,7 @@ void channel_destroy(CHANNEL_REC *channel)
        channel->destroying = TRUE;
 
        channels = g_slist_remove(channels, channel);
-       if (channel->server != NULL)
+       if (!channel->server->disconnected)
                channel->server->channels = g_slist_remove(channel->server->channels, channel);
        signal_emit("channel destroyed", 1, channel);
 
index 0899c9fa3c725d5fdd76de9536ca2a8506387314..96a740088015aab24d271e97d8fb1858cf6defcc 100644 (file)
@@ -72,10 +72,10 @@ static COMMAND_MODULE_REC *command_module_find(COMMAND_REC *rec,
        return NULL;
 }
 
-static COMMAND_MODULE_REC *command_module_find_func(COMMAND_REC *rec,
-                                                   SIGNAL_FUNC func)
+static COMMAND_MODULE_REC *
+command_module_find_and_remove(COMMAND_REC *rec, SIGNAL_FUNC func)
 {
-       GSList *tmp;
+       GSList *tmp, *tmp2;
 
        g_return_val_if_fail(rec != NULL, NULL);
        g_return_val_if_fail(func != NULL, NULL);
@@ -83,8 +83,15 @@ static COMMAND_MODULE_REC *command_module_find_func(COMMAND_REC *rec,
        for (tmp = rec->modules; tmp != NULL; tmp = tmp->next) {
                COMMAND_MODULE_REC *rec = tmp->data;
 
-                if (g_slist_find(rec->signals, (void *) func) != NULL)
-                       return rec;
+               for (tmp2 = rec->callbacks; tmp2 != NULL; tmp2 = tmp2->next) {
+                       COMMAND_CALLBACK_REC *cb = tmp2->data;
+
+                       if (cb->func == func) {
+                               rec->callbacks =
+                                       g_slist_remove(rec->callbacks, cb);
+                               return rec;
+                       }
+               }
        }
 
        return NULL;
@@ -131,11 +138,13 @@ command_module_get(COMMAND_REC *rec, const char *module, int protocol)
         return modrec;
 }
 
-void command_bind_to(const char *module, int pos, const char *cmd,
-                    int protocol, const char *category, SIGNAL_FUNC func)
+void command_bind_full(const char *module, int priority, const char *cmd,
+                      int protocol, const char *category, SIGNAL_FUNC func,
+                      void *user_data)
 {
        COMMAND_REC *rec;
-        COMMAND_MODULE_REC *modrec;
+       COMMAND_MODULE_REC *modrec;
+        COMMAND_CALLBACK_REC *cb;
        char *str;
 
        g_return_if_fail(module != NULL);
@@ -150,11 +159,14 @@ void command_bind_to(const char *module, int pos, const char *cmd,
        }
         modrec = command_module_get(rec, module, protocol);
 
-        modrec->signals = g_slist_append(modrec->signals, (void *) func);
+       cb = g_new0(COMMAND_CALLBACK_REC, 1);
+       cb->func = func;
+       cb->user_data = user_data;
+       modrec->callbacks = g_slist_append(modrec->callbacks, cb);
 
        if (func != NULL) {
                str = g_strconcat("command ", cmd, NULL);
-               signal_add_to(module, pos, str, func);
+               signal_add_full(module, priority, str, func, user_data);
                g_free(str);
        }
 
@@ -176,7 +188,8 @@ static void command_module_free(COMMAND_MODULE_REC *modrec, COMMAND_REC *rec)
 {
        rec->modules = g_slist_remove(rec->modules, modrec);
 
-       g_slist_free(modrec->signals);
+       g_slist_foreach(modrec->callbacks, (GFunc) g_free, NULL);
+       g_slist_free(modrec->callbacks);
         g_free(modrec->name);
         g_free_not_null(modrec->options);
         g_free(modrec);
@@ -196,7 +209,7 @@ static void command_module_destroy(COMMAND_REC *rec,
        for (tmp = rec->modules; tmp != NULL; tmp = tmp->next) {
                COMMAND_MODULE_REC *rec = tmp->data;
 
-               if (rec->signals == NULL)
+               if (rec->callbacks == NULL)
                        freelist = g_slist_append(freelist, rec);
                else {
                         g_slist_free(freelist);
@@ -212,10 +225,10 @@ static void command_module_destroy(COMMAND_REC *rec,
                command_free(rec);
 }
 
-void command_unbind(const char *cmd, SIGNAL_FUNC func)
+void command_unbind_full(const char *cmd, SIGNAL_FUNC func, void *user_data)
 {
        COMMAND_REC *rec;
-        COMMAND_MODULE_REC *modrec;
+       COMMAND_MODULE_REC *modrec;
        char *str;
 
        g_return_if_fail(cmd != NULL);
@@ -223,17 +236,15 @@ void command_unbind(const char *cmd, SIGNAL_FUNC func)
 
        rec = command_find(cmd);
        if (rec != NULL) {
-               modrec = command_module_find_func(rec, func);
+               modrec = command_module_find_and_remove(rec, func);
                g_return_if_fail(modrec != NULL);
 
-               modrec->signals =
-                       g_slist_remove(modrec->signals, (void *) func);
-               if (modrec->signals == NULL)
+               if (modrec->callbacks == NULL)
                        command_module_destroy(rec, modrec);
        }
 
        str = g_strconcat("command ", cmd, NULL);
-       signal_remove(str, func);
+       signal_remove_data(str, func, user_data);
        g_free(str);
 }
 
@@ -767,10 +778,11 @@ static void command_module_unbind_all(COMMAND_REC *rec,
 {
        GSList *tmp, *next;
 
-       for (tmp = modrec->signals; tmp != NULL; tmp = next) {
+       for (tmp = modrec->callbacks; tmp != NULL; tmp = next) {
+               COMMAND_CALLBACK_REC *cb = tmp->data;
                next = tmp->next;
 
-               command_unbind(rec->cmd, (SIGNAL_FUNC) tmp->data);
+               command_unbind_full(rec->cmd, cb->func, cb->user_data);
        }
 
        if (g_slist_find(commands, rec) != NULL) {
index e3bf4374346d94e32242878ee8bce9efff304f90..1733c589e4debbfacaea7f3881474934e928f924 100644 (file)
@@ -3,11 +3,16 @@
 
 #include "signals.h"
 
+typedef struct {
+       SIGNAL_FUNC func;
+       void *user_data;
+} COMMAND_CALLBACK_REC;
+
 typedef struct {
        char *name;
        char *options;
         int protocol; /* chat protocol required for this command */
-        GSList *signals;
+        GSList *callbacks;
 } COMMAND_MODULE_REC;
 
 typedef struct {
@@ -57,17 +62,23 @@ extern GSList *commands;
 extern char *current_command; /* the command we're right now. */
 
 /* Bind command to specified function. */
-void command_bind_to(const char *module, int pos, const char *cmd,
-                     int protocol, const char *category, SIGNAL_FUNC func);
-#define command_bind(a, b, c) command_bind_to(MODULE_NAME, 1, a, -1, b, c)
-#define command_bind_first(a, b, c) command_bind_to(MODULE_NAME, 0, a, -1, b, c)
-#define command_bind_last(a, b, c) command_bind_to(MODULE_NAME, 2, a, -1, b, c)
-
-#define command_bind_proto(a, b, c, d) command_bind_to(MODULE_NAME, 1, a, b, c, d)
-#define command_bind_proto_first(a, b, c, d) command_bind_to(MODULE_NAME, 0, a, b, c, d)
-#define command_bind_proto_last(a, b, c, d) command_bind_to(MODULE_NAME, 2, a, b, c, d)
-
-void command_unbind(const char *cmd, SIGNAL_FUNC func);
+void command_bind_full(const char *module, int priority, const char *cmd,
+                      int protocol, const char *category, SIGNAL_FUNC func,
+                      void *user_data);
+#define command_bind(a, b, c) command_bind_full(MODULE_NAME, SIGNAL_PRIORITY_DEFAULT, a, -1, b, c, NULL)
+#define command_bind_first(a, b, c) command_bind_full(MODULE_NAME, SIGNAL_PRIORITY_HIGH, a, -1, b, c, NULL)
+#define command_bind_last(a, b, c) command_bind_full(MODULE_NAME, SIGNAL_PRIORITY_LOW, a, -1, b, c, NULL)
+
+#define command_bind_data(a, b, c, d) command_bind_full(MODULE_NAME, SIGNAL_PRIORITY_DEFAULT, a, -1, b, c, d)
+#define command_bind_data_first(a, b, c, d) command_bind_full(MODULE_NAME, SIGNAL_PRIORITY_HIGH, a, -1, b, c, d)
+#define command_bind_data_last(a, b, c, d) command_bind_full(MODULE_NAME, SIGNAL_PRIORITY_LOW, a, -1, b, c, d)
+
+#define command_bind_proto(a, b, c, d) command_bind_full(MODULE_NAME, SIGNAL_PRIORITY_DEFAULT, a, b, c, d, NULL)
+#define command_bind_proto_first(a, b, c, d) command_bind_full(MODULE_NAME, SIGNAL_PRIORITY_HIGH, a, b, c, d, NULL)
+#define command_bind_proto_last(a, b, c, d) command_bind_full(MODULE_NAME, SIGNAL_PRIORITY_LOW, a, b, c, d, NULL)
+
+void command_unbind_full(const char *cmd, SIGNAL_FUNC func, void *user_data);
+#define command_unbind(cmd, func) command_unbind_full(cmd, func, NULL)
 
 /* Run subcommand, `cmd' contains the base command, first word in `data'
    contains the subcommand */
index 130d6025d3e2ad1bb023f9221401a8df471c02e1..5cec556185dbf64b6356b5c6545806c7fcd8fca1 100644 (file)
@@ -179,7 +179,8 @@ void expando_bind(const char *key, int funccount, SIGNAL_FUNC *funcs)
                func = arg < funccount ? funcs[arg] : NULL;
                if (func == NULL) func = funcs[EXPANDO_ARG_NONE];
 
-               signal_add_to_id(MODULE_NAME, 1, rec->signal_ids[n], func);
+               signal_add_full_id(MODULE_NAME, SIGNAL_PRIORITY_DEFAULT,
+                                  rec->signal_ids[n], func, NULL);
        }
 }
 
@@ -208,7 +209,7 @@ void expando_unbind(const char *key, int funccount, SIGNAL_FUNC *funcs)
                func = arg < funccount ? funcs[arg] : NULL;
                if (func == NULL) func = funcs[EXPANDO_ARG_NONE];
 
-               signal_remove_id(rec->signal_ids[n], func);
+               signal_remove_id(rec->signal_ids[n], func, NULL);
        }
 }
 
index 7014e431b500efa311546f63bbe2cfb613befd93..02c7655c4c2e4a9eadaf1803863a4ea152419df1 100644 (file)
@@ -30,6 +30,7 @@ static int check_address(const char *mask, int *wildcards)
 {
        int ret;
 
+       *wildcards = FALSE;
        ret = FALSE;
        while (*mask != '\0') {
                if (*mask == '!') {
index f4aae6e7f219392a4774909ebd104bd890c003bc..8ae994a285e6dcc051d76d794e2e3cd1fcc253b5 100644 (file)
@@ -37,6 +37,7 @@ void query_init(QUERY_REC *query, int automatic)
         MODULE_DATA_INIT(query);
        query->type = module_get_uniq_id_str("WINDOW ITEM TYPE", "QUERY");
         query->destroy = (void (*) (WI_ITEM_REC *)) query_destroy;
+       query->createtime = time(NULL);
        query->last_unread_msg = time(NULL);
 
        if (query->server_tag != NULL) {
@@ -124,6 +125,7 @@ void query_change_nick(QUERY_REC *query, const char *nick)
         oldnick = query->name;
        query->name = g_strdup(nick);
        signal_emit("query nick changed", 2, query, oldnick);
+       signal_emit("window item name changed", 1, query);
         g_free(oldnick);
 }
 
index e51a3fa23f03393d6a46a05ada427c9c804307d9..1b17c921a4dc60bc45fc303430bbcdb6b067964f 100644 (file)
@@ -162,6 +162,7 @@ server_connect_copy_skeleton(SERVER_CONNECT_REC *src, int connect_info)
 
        dest->channels = g_strdup(src->channels);
        dest->away_reason = g_strdup(src->away_reason);
+        dest->no_autojoin_channels = src->no_autojoin_channels;
 
        return dest;
 }
index a5a8c701703005397fb2d62c5ca2451d85169420..1e5c0b8487c70fb482dbdf83b80452911c38fcf1 100644 (file)
@@ -257,6 +257,8 @@ static void server_connect_callback_readpipe(SERVER_REC *server)
 /* initializes server record but doesn't start connecting */
 void server_connect_init(SERVER_REC *server)
 {
+       const char *str;
+
        g_return_if_fail(server != NULL);
 
        MODULE_DATA_INIT(server);
@@ -267,16 +269,16 @@ void server_connect_init(SERVER_REC *server)
        if (server->connrec->username == NULL || *server->connrec->username == '\0') {
                g_free_not_null(server->connrec->username);
 
-               server->connrec->username = g_get_user_name();
-               if (*server->connrec->username == '\0') server->connrec->username = "-";
-               server->connrec->username = g_strdup(server->connrec->username);
+               str = g_get_user_name();
+               if (*str == '\0') str = "-";
+               server->connrec->username = g_strdup(str);
        }
        if (server->connrec->realname == NULL || *server->connrec->realname == '\0') {
                g_free_not_null(server->connrec->realname);
 
-               server->connrec->realname = g_get_real_name();
-               if (*server->connrec->realname == '\0') server->connrec->realname = "-";
-               server->connrec->realname = g_strdup(server->connrec->realname);
+               str = g_get_real_name();
+               if (*str == '\0') str = "-";
+               server->connrec->realname = g_strdup(str);
        }
 
        server->tag = server_create_tag(server->connrec);
@@ -331,7 +333,6 @@ static int server_remove_channels(SERVER_REC *server)
        for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
                CHANNEL_REC *channel = tmp->data;
 
-               channel->server = NULL;
                channel_destroy(channel);
                found = TRUE;
        }
index 7e7b0afa1cf21567fa2868de2f454c88d251aefb..b541913489385e674326e0e3426a55fc8c966a46 100644 (file)
@@ -39,6 +39,7 @@ static char **session_args;
 
 void session_set_binary(const char *path)
 {
+       const char *envpath;
        char **paths, **tmp;
         char *str;
 
@@ -59,10 +60,10 @@ void session_set_binary(const char *path)
        }
 
        /* we'll need to find it from path. */
-       str = g_getenv("PATH");
-       if (str == NULL) return;
+       envpath = g_getenv("PATH");
+       if (envpath == NULL) return;
 
-       paths = g_strsplit(str, ":", -1);
+       paths = g_strsplit(envpath, ":", -1);
        for (tmp = paths; *tmp != NULL; tmp++) {
                 str = g_strconcat(*tmp, G_DIR_SEPARATOR_S, path, NULL);
                if (access(str, X_OK) == 0) {
index 92064e8d4cf0d272180baee97f151145d63917bd..316424522f7f49e9efe122584f591729586b3ce6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  signals.c : irssi
 
-    Copyright (C) 1999 Timo Sirainen
+    Copyright (C) 1999-2002 Timo Sirainen
 
     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
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include "../common.h"
+#include "module.h"
 #include "signals.h"
 #include "modules.h"
 
-#define SIGNAL_LISTS 3
+typedef struct _SignalHook {
+       struct _SignalHook *next;
+
+        int priority;
+       const char *module;
+       SIGNAL_FUNC func;
+       void *user_data;
+} SignalHook;
 
 typedef struct {
        int id; /* signal id */
@@ -30,207 +37,233 @@ typedef struct {
 
        int emitting; /* signal is being emitted */
        int stop_emit; /* this signal was stopped */
+       int continue_emit; /* this signal emit was continued elsewhere */
+        int remove_count; /* hooks were removed from signal */
 
-       GPtrArray *modulelist[SIGNAL_LISTS]; /* list of what signals belong
-                                               to which module */
-       GPtrArray *siglist[SIGNAL_LISTS]; /* signal lists */
-} SIGNAL_REC;
+        SignalHook *hooks;
+} Signal;
 
-#define signal_is_emitlist_empty(a) \
-       (!(a)->siglist[0] && !(a)->siglist[1] && !(a)->siglist[2])
+void *signal_user_data;
 
-static GMemChunk *signals_chunk;
 static GHashTable *signals;
-static SIGNAL_REC *current_emitted_signal;
+static Signal *current_emitted_signal;
+static SignalHook *current_emitted_hook;
 
 #define signal_ref(signal) ++(signal)->refcount
-#define signal_unref(rec) (signal_unref_full(rec, TRUE))
+#define signal_unref(signal) (signal_unref_full(signal, TRUE))
 
-static int signal_unref_full(SIGNAL_REC *rec, int remove_hash)
+static int signal_unref_full(Signal *rec, int remove)
 {
-       if (rec->refcount == 0) {
-               g_error("signal_unref(%s) : BUG - reference counter == 0",
-                       signal_get_id_str(rec->id));
-       }
+        g_assert(rec->refcount > 0);
 
        if (--rec->refcount != 0)
-               return FALSE;
+               return TRUE;
 
        /* remove whole signal from memory */
-       if (!signal_is_emitlist_empty(rec)) {
-               g_error("signal_unref(%s) : BUG - emitlist wasn't empty",
+       if (rec->hooks != NULL) {
+               g_error("signal_unref(%s) : BUG - hook list wasn't empty",
                        signal_get_id_str(rec->id));
        }
 
-       if (remove_hash)
+       if (remove)
                g_hash_table_remove(signals, GINT_TO_POINTER(rec->id));
-       g_mem_chunk_free(signals_chunk, rec);
-       return TRUE;
+        g_free(rec);
+
+       return FALSE;
 }
 
-static void signal_unref_count(SIGNAL_REC *rec, int count)
+static void signal_hash_ref(void *key, Signal *rec)
 {
-       while (count-- > 0)
-                signal_unref(rec);
+       signal_ref(rec);
 }
 
-void signal_add_to(const char *module, int pos,
-                  const char *signal, SIGNAL_FUNC func)
+static int signal_hash_unref(void *key, Signal *rec)
 {
-       g_return_if_fail(signal != NULL);
+       return !signal_unref_full(rec, FALSE);
+}
 
-       signal_add_to_id(module, pos, signal_get_uniq_id(signal), func);
+void signal_add_full(const char *module, int priority,
+                    const char *signal, SIGNAL_FUNC func, void *user_data)
+{
+       signal_add_full_id(module, priority, signal_get_uniq_id(signal),
+                          func, user_data);
 }
 
 /* bind a signal */
-void signal_add_to_id(const char *module, int pos,
-                     int signal_id, SIGNAL_FUNC func)
+void signal_add_full_id(const char *module, int priority,
+                       int signal_id, SIGNAL_FUNC func, void *user_data)
 {
-       SIGNAL_REC *rec;
+       Signal *signal;
+        SignalHook *hook, **tmp;
 
        g_return_if_fail(signal_id >= 0);
        g_return_if_fail(func != NULL);
-       g_return_if_fail(pos >= 0 && pos < SIGNAL_LISTS);
-
-       rec = g_hash_table_lookup(signals, GINT_TO_POINTER(signal_id));
-       if (rec == NULL) {
-               rec = g_mem_chunk_alloc0(signals_chunk);
-               rec->id = signal_id;
-               g_hash_table_insert(signals, GINT_TO_POINTER(signal_id), rec);
-       }
 
-       if (rec->siglist[pos] == NULL) {
-               rec->siglist[pos] = g_ptr_array_new();
-               rec->modulelist[pos] = g_ptr_array_new();
+       signal = g_hash_table_lookup(signals, GINT_TO_POINTER(signal_id));
+       if (signal == NULL) {
+                /* new signal */
+               signal = g_new0(Signal, 1);
+               signal->id = signal_id;
+               g_hash_table_insert(signals, GINT_TO_POINTER(signal_id), signal);
        }
 
-       g_ptr_array_add(rec->siglist[pos], (void *) func);
-       g_ptr_array_add(rec->modulelist[pos], (void *) module);
-
-        signal_ref(rec);
-}
-
-static int signal_list_find(GPtrArray *array, void *data)
-{
-       unsigned int n;
-
-       for (n = 0; n < array->len; n++) {
-               if (g_ptr_array_index(array, n) == data)
-                       return n;
+       hook = g_new0(SignalHook, 1);
+       hook->priority = priority;
+       hook->module = module;
+       hook->func = func;
+       hook->user_data = user_data;
+
+       /* insert signal to proper position in list */
+       for (tmp = &signal->hooks; ; tmp = &(*tmp)->next) {
+               if (*tmp == NULL) {
+                        /* last in list */
+                       *tmp = hook;
+                        break;
+               } else if (priority <= (*tmp)->priority) {
+                        /* insert before others with same priority */
+                       hook->next = *tmp;
+                       *tmp = hook;
+                        break;
+               }
        }
 
-       return -1;
+        signal_ref(signal);
 }
 
-static void signal_list_free(SIGNAL_REC *rec, int list)
+static void signal_remove_hook(Signal *rec, SignalHook **hook_pos)
 {
-       g_ptr_array_free(rec->siglist[list], TRUE);
-       g_ptr_array_free(rec->modulelist[list], TRUE);
-       rec->siglist[list] = NULL;
-       rec->modulelist[list] = NULL;
-}
+       SignalHook *hook;
 
-/* Returns TRUE if the whole signal is removed after this remove */
-static void signal_remove_from_list(SIGNAL_REC *rec, int list, int index)
-{
-       g_ptr_array_remove_index(rec->siglist[list], index);
-       g_ptr_array_remove_index(rec->modulelist[list], index);
+        hook = *hook_pos;
+        *hook_pos = hook->next;
 
-       if (rec->siglist[list]->len == 0)
-               signal_list_free(rec, list);
+       g_free(hook);
 
        signal_unref(rec);
 }
 
-/* Remove signal from emit lists */
-static int signal_remove_from_lists(SIGNAL_REC *rec, SIGNAL_FUNC func)
+/* Remove function from signal's emit list */
+static int signal_remove_func(Signal *rec, SIGNAL_FUNC func, void *user_data)
 {
-       int n, index;
-
-       for (n = 0; n < SIGNAL_LISTS; n++) {
-               if (rec->siglist[n] == NULL)
-                       continue;
-
-               index = signal_list_find(rec->siglist[n], (void *) func);
-               if (index != -1) {
-                       /* remove the function from emit list */
-                       signal_remove_from_list(rec, n, index);
-                       return 1;
+        SignalHook **hook;
+
+       for (hook = &rec->hooks; *hook != NULL; hook = &(*hook)->next) {
+               if ((*hook)->func == func && (*hook)->user_data == user_data) {
+                       if (rec->emitting) {
+                               /* mark it removed after emitting is done */
+                               (*hook)->func = NULL;
+                                rec->remove_count++;
+                       } else {
+                               /* remove the function from emit list */
+                               signal_remove_hook(rec, hook);
+                       }
+                       return TRUE;
                }
        }
 
-        return 0;
+        return FALSE;
 }
 
-void signal_remove_id(int signal_id, SIGNAL_FUNC func)
+void signal_remove_id(int signal_id, SIGNAL_FUNC func, void *user_data)
 {
-       SIGNAL_REC *rec;
+       Signal *rec;
 
        g_return_if_fail(signal_id >= 0);
        g_return_if_fail(func != NULL);
 
        rec = g_hash_table_lookup(signals, GINT_TO_POINTER(signal_id));
         if (rec != NULL)
-               signal_remove_from_lists(rec, func);
+                signal_remove_func(rec, func, user_data);
 }
 
 /* unbind signal */
-void signal_remove(const char *signal, SIGNAL_FUNC func)
+void signal_remove_full(const char *signal, SIGNAL_FUNC func, void *user_data)
 {
        g_return_if_fail(signal != NULL);
 
-       signal_remove_id(signal_get_uniq_id(signal), func);
+       signal_remove_id(signal_get_uniq_id(signal), func, user_data);
+}
+
+static void signal_hooks_clean(Signal *rec)
+{
+       SignalHook **hook, **next;
+        int count;
+
+        count = rec->remove_count;
+        rec->remove_count = 0;
+
+       for (hook = &rec->hooks; *hook != NULL; hook = next) {
+               next = &(*hook)->next;
+
+               if ((*hook)->func == NULL) {
+                        next = hook;
+                       signal_remove_hook(rec, hook);
+
+                       if (--count == 0)
+                                break;
+               }
+       }
 }
 
-static int signal_emit_real(SIGNAL_REC *rec, int params, va_list va)
+static int signal_emit_real(Signal *rec, int params, va_list va,
+                           SignalHook *first_hook)
 {
-       gconstpointer arglist[SIGNAL_MAX_ARGUMENTS];
-        SIGNAL_REC *prev_emitted_signal;
-        SIGNAL_FUNC func;
-       int n, index, stopped, stop_emit_count;
+       const void *arglist[SIGNAL_MAX_ARGUMENTS];
+       Signal *prev_emitted_signal;
+        SignalHook *hook, *prev_emitted_hook;
+       int i, stopped, stop_emit_count, continue_emit_count;
 
-       for (n = 0; n < SIGNAL_MAX_ARGUMENTS; n++)
-               arglist[n] = n >= params ? NULL : va_arg(va, gconstpointer);
+       for (i = 0; i < SIGNAL_MAX_ARGUMENTS; i++)
+               arglist[i] = i >= params ? NULL : va_arg(va, const void *);
 
        /* signal_stop_by_name("signal"); signal_emit("signal", ...);
           fails if we compare rec->stop_emit against 0. */
        stop_emit_count = rec->stop_emit;
+       continue_emit_count = rec->continue_emit;
 
         signal_ref(rec);
 
        stopped = FALSE;
        rec->emitting++;
-       for (n = 0; n < SIGNAL_LISTS; n++) {
-               /* run signals in emit lists */
-               if (rec->siglist[n] == NULL)
-                       continue;
 
-               for (index = rec->siglist[n]->len-1; index >= 0; index--) {
-                       func = (SIGNAL_FUNC) g_ptr_array_index(rec->siglist[n], index);
+       prev_emitted_signal = current_emitted_signal;
+       prev_emitted_hook = current_emitted_hook;
+       current_emitted_signal = rec;
 
-                       prev_emitted_signal = current_emitted_signal;
-                       current_emitted_signal = rec;
+       for (hook = first_hook; hook != NULL; hook = hook->next) {
+               if (hook->func == NULL)
+                       continue; /* removed */
+
+               current_emitted_hook = hook;
 #if SIGNAL_MAX_ARGUMENTS != 6
 #  error SIGNAL_MAX_ARGUMENTS changed - update code
 #endif
-                       func(arglist[0], arglist[1], arglist[2], arglist[3], arglist[4], arglist[5]);
-                       current_emitted_signal = prev_emitted_signal;
-
-                       if (rec->stop_emit != stop_emit_count) {
-                               stopped = TRUE;
-                               rec->stop_emit--;
-                               n = SIGNAL_LISTS;
-                               break;
-                       }
+                signal_user_data = hook->user_data;
+               hook->func(arglist[0], arglist[1], arglist[2], arglist[3],
+                          arglist[4], arglist[5]);
+
+               if (rec->continue_emit != continue_emit_count)
+                       rec->continue_emit--;
+
+               if (rec->stop_emit != stop_emit_count) {
+                       stopped = TRUE;
+                       rec->stop_emit--;
+                       break;
                }
        }
+
+       current_emitted_signal = prev_emitted_signal;
+       current_emitted_hook = prev_emitted_hook;
+
        rec->emitting--;
+       signal_user_data = NULL;
 
        if (!rec->emitting) {
-               if (rec->stop_emit != 0) {
-                       /* signal_stop() used too many times */
-                        rec->stop_emit = 0;
-               }
+               g_assert(rec->stop_emit == 0);
+               g_assert(rec->continue_emit == 0);
+
+                if (rec->remove_count > 0)
+                       signal_hooks_clean(rec);
        }
 
         signal_unref(rec);
@@ -239,7 +272,7 @@ static int signal_emit_real(SIGNAL_REC *rec, int params, va_list va)
 
 int signal_emit(const char *signal, int params, ...)
 {
-       SIGNAL_REC *rec;
+       Signal *rec;
        va_list va;
        int signal_id;
 
@@ -250,7 +283,7 @@ int signal_emit(const char *signal, int params, ...)
        rec = g_hash_table_lookup(signals, GINT_TO_POINTER(signal_id));
        if (rec != NULL) {
                va_start(va, params);
-               signal_emit_real(rec, params, va);
+               signal_emit_real(rec, params, va, rec->hooks);
                va_end(va);
        }
 
@@ -259,7 +292,7 @@ int signal_emit(const char *signal, int params, ...)
 
 int signal_emit_id(int signal_id, int params, ...)
 {
-       SIGNAL_REC *rec;
+       Signal *rec;
        va_list va;
 
        g_return_val_if_fail(signal_id >= 0, FALSE);
@@ -268,17 +301,39 @@ int signal_emit_id(int signal_id, int params, ...)
        rec = g_hash_table_lookup(signals, GINT_TO_POINTER(signal_id));
        if (rec != NULL) {
                va_start(va, params);
-               signal_emit_real(rec, params, va);
+               signal_emit_real(rec, params, va, rec->hooks);
                va_end(va);
        }
 
        return rec != NULL;
 }
 
+void signal_continue(int params, ...)
+{
+       Signal *rec;
+       va_list va;
+
+       rec = current_emitted_signal;
+       if (rec == NULL || rec->emitting <= rec->continue_emit)
+               g_warning("signal_continue() : no signals are being emitted currently");
+       else {
+               va_start(va, params);
+
+               /* stop the signal */
+               if (rec->emitting > rec->stop_emit)
+                       rec->stop_emit++;
+
+               /* re-emit */
+               rec->continue_emit++;
+               signal_emit_real(rec, params, va, current_emitted_hook->next);
+               va_end(va);
+       }
+}
+
 /* stop the current ongoing signal emission */
 void signal_stop(void)
 {
-       SIGNAL_REC *rec;
+       Signal *rec;
 
        rec = current_emitted_signal;
        if (rec == NULL)
@@ -290,7 +345,7 @@ void signal_stop(void)
 /* stop ongoing signal emission by signal name */
 void signal_stop_by_name(const char *signal)
 {
-       SIGNAL_REC *rec;
+       Signal *rec;
        int signal_id;
 
        signal_id = signal_get_uniq_id(signal);
@@ -310,7 +365,7 @@ const char *signal_get_emitted(void)
 /* return the ID of the signal that is currently being emitted */
 int signal_get_emitted_id(void)
 {
-       SIGNAL_REC *rec;
+       Signal *rec;
 
        rec = current_emitted_signal;
         g_return_val_if_fail(rec != NULL, -1);
@@ -320,7 +375,7 @@ int signal_get_emitted_id(void)
 /* return TRUE if specified signal was stopped */
 int signal_is_stopped(int signal_id)
 {
-       SIGNAL_REC *rec;
+       Signal *rec;
 
        rec = g_hash_table_lookup(signals, GINT_TO_POINTER(signal_id));
        g_return_val_if_fail(rec != NULL, FALSE);
@@ -328,73 +383,57 @@ int signal_is_stopped(int signal_id)
         return rec->emitting <= rec->stop_emit;
 }
 
-static void signal_remove_module(void *signal, SIGNAL_REC *rec,
+static void signal_remove_module(void *signal, Signal *rec,
                                 const char *module)
 {
-        unsigned int index;
-       int list;
+       SignalHook **hook, **next;
 
-       for (list = 0; list < SIGNAL_LISTS; list++) {
-               if (rec->modulelist[list] == NULL)
-                       continue;
+       for (hook = &rec->hooks; *hook != NULL; hook = next) {
+               next = &(*hook)->next;
 
-               for (index = rec->modulelist[list]->len; index > 0; index--)
-                       if (g_strcasecmp(g_ptr_array_index(rec->modulelist[list], index-1), module) == 0)
-                               signal_remove_from_list(rec, list, index-1);
+               if (strcasecmp((*hook)->module, module) == 0) {
+                        next = hook;
+                       signal_remove_hook(rec, hook);
+               }
        }
 }
 
-static void signal_foreach_ref(void *signal, SIGNAL_REC *rec)
-{
-        signal_ref(rec);
-}
-
-static int signal_foreach_unref(void *signal, SIGNAL_REC *rec)
-{
-        return signal_unref_full(rec, FALSE);
-}
-
 /* remove all signals that belong to `module' */
 void signals_remove_module(const char *module)
 {
        g_return_if_fail(module != NULL);
 
-       g_hash_table_foreach(signals, (GHFunc) signal_foreach_ref, NULL);
-       g_hash_table_foreach(signals, (GHFunc) signal_remove_module, (void *) module);
-       g_hash_table_foreach_remove(signals, (GHRFunc) signal_foreach_unref, NULL);
+       g_hash_table_foreach(signals, (GHFunc) signal_hash_ref, NULL);
+       g_hash_table_foreach(signals, (GHFunc) signal_remove_module,
+                            (void *) module);
+       g_hash_table_foreach_remove(signals, (GHRFunc) signal_hash_unref, NULL);
 }
 
 void signals_init(void)
 {
-       signals_chunk = g_mem_chunk_new("signals", sizeof(SIGNAL_REC),
-                                       sizeof(SIGNAL_REC)*200, G_ALLOC_AND_FREE);
-       signals = g_hash_table_new((GHashFunc) g_direct_hash, (GCompareFunc) g_direct_equal);
+       signals = g_hash_table_new(NULL, NULL);
 }
 
-static void signal_free(void *key, SIGNAL_REC *rec)
+static void signal_free(void *key, Signal *rec)
 {
-       int n;
+       /* refcount-1 because we just referenced it ourself */
+       g_warning("signal_free(%s) : signal still has %d references:",
+                 signal_get_id_str(rec->id), rec->refcount-1);
 
-        signal_ref(rec);
-
-       for (n = 0; n < SIGNAL_LISTS; n++) {
-               if (rec->siglist[n] != NULL) {
-                       signal_unref_count(rec, rec->siglist[n]->len);
-                        signal_list_free(rec, n);
-               }
-       }
+       while (rec->hooks != NULL) {
+               g_warning(" - module '%s' function %p",
+                         rec->hooks->module, rec->hooks->func);
 
-       if (!signal_unref_full(rec, FALSE)) {
-               g_error("signal_free(%s) : BUG - signal still has %d references",
-                       signal_get_id_str(rec->id), rec->refcount);
+               signal_remove_hook(rec, &rec->hooks);
        }
 }
 
 void signals_deinit(void)
 {
-       g_hash_table_foreach(signals, (GHFunc) signal_free, NULL);
+       g_hash_table_foreach(signals, (GHFunc) signal_hash_ref, NULL);
+        g_hash_table_foreach(signals, (GHFunc) signal_free, NULL);
+       g_hash_table_foreach_remove(signals, (GHRFunc) signal_hash_unref, NULL);
        g_hash_table_destroy(signals);
 
        module_uniq_destroy("signals");
-       g_mem_chunk_destroy(signals_chunk);
 }
index 795f7327fbb01f0af10b2ddc038b642614e8b024..384af66f34e5bcd0f0357fa81747c4afdfffa22f 100644 (file)
@@ -1,38 +1,51 @@
 #ifndef __SIGNAL_H
 #define __SIGNAL_H
 
+#define SIGNAL_PRIORITY_LOW            100
+#define SIGNAL_PRIORITY_DEFAULT        0
+#define SIGNAL_PRIORITY_HIGH   -100
+
 #define SIGNAL_MAX_ARGUMENTS 6
-typedef void (*SIGNAL_FUNC) (gconstpointer, gconstpointer,
-                            gconstpointer, gconstpointer,
-                            gconstpointer, gconstpointer);
+typedef void (*SIGNAL_FUNC) (const void *, const void *,
+                            const void *, const void *,
+                            const void *, const void *);
 
-void signals_init(void);
-void signals_deinit(void);
-
-/* signal name -> ID */
-#define signal_get_uniq_id(signal) \
-        module_get_uniq_id_str("signals", signal)
-/* signal ID -> name */
-#define signal_get_id_str(signal_id) \
-       module_find_id_str("signals", signal_id)
+extern void *signal_user_data; /* use signal_get_user_data() macro to access */
 
 /* bind a signal */
-void signal_add_to(const char *module, int pos,
-                  const char *signal, SIGNAL_FUNC func);
-void signal_add_to_id(const char *module, int pos,
-                     int signal, SIGNAL_FUNC func);
-#define signal_add(a, b) signal_add_to(MODULE_NAME, 1, a, b)
-#define signal_add_first(a, b) signal_add_to(MODULE_NAME, 0, a, b)
-#define signal_add_last(a, b) signal_add_to(MODULE_NAME, 2, a, b)
+void signal_add_full(const char *module, int priority,
+                    const char *signal, SIGNAL_FUNC func, void *user_data);
+void signal_add_full_id(const char *module, int priority,
+                       int signal, SIGNAL_FUNC func, void *user_data);
+#define signal_add(signal, func) \
+       signal_add_full(MODULE_NAME, SIGNAL_PRIORITY_DEFAULT, (signal), (SIGNAL_FUNC) (func), NULL)
+#define signal_add_first(signal, func) \
+       signal_add_full(MODULE_NAME, SIGNAL_PRIORITY_HIGH, (signal), (SIGNAL_FUNC) (func), NULL)
+#define signal_add_last(signal, func) \
+       signal_add_full(MODULE_NAME, SIGNAL_PRIORITY_LOW, (signal), (SIGNAL_FUNC) (func), NULL)
+
+#define signal_add_data(signal, func, data) \
+       signal_add_full(MODULE_NAME, SIGNAL_PRIORITY_DEFAULT, (signal), (SIGNAL_FUNC) (func), data)
+#define signal_add_first_data(signal, func, data) \
+       signal_add_full(MODULE_NAME, SIGNAL_PRIORITY_HIGH, (signal), (SIGNAL_FUNC) (func), data)
+#define signal_add_last_data(signal, func, data) \
+       signal_add_full(MODULE_NAME, SIGNAL_PRIORITY_LOW, (signal), (SIGNAL_FUNC) (func), data)
 
 /* unbind signal */
-void signal_remove(const char *signal, SIGNAL_FUNC func);
-void signal_remove_id(int signal_id, SIGNAL_FUNC func);
+void signal_remove_full(const char *signal, SIGNAL_FUNC func, void *user_data);
+#define signal_remove(signal, func) \
+        signal_remove_full((signal), (SIGNAL_FUNC) (func), NULL)
+#define signal_remove_data(signal, func, data) \
+        signal_remove_full((signal), (SIGNAL_FUNC) (func), data)
+void signal_remove_id(int signal_id, SIGNAL_FUNC func, void *user_data);
 
 /* emit signal */
 int signal_emit(const char *signal, int params, ...);
 int signal_emit_id(int signal_id, int params, ...);
 
+/* continue currently emitted signal with different parameters */
+void signal_continue(int params, ...);
+
 /* stop the current ongoing signal emission */
 void signal_stop(void);
 /* stop ongoing signal emission by signal name */
@@ -44,8 +57,20 @@ const char *signal_get_emitted(void);
 int signal_get_emitted_id(void);
 /* return TRUE if specified signal was stopped */
 int signal_is_stopped(int signal_id);
+/* return the user data of the signal function currently being emitted */
+#define signal_get_user_data() signal_user_data
 
 /* remove all signals that belong to `module' */
 void signals_remove_module(const char *module);
 
+/* signal name -> ID */
+#define signal_get_uniq_id(signal) \
+        module_get_uniq_id_str("signals", signal)
+/* signal ID -> name */
+#define signal_get_id_str(signal_id) \
+       module_find_id_str("signals", signal_id)
+
+void signals_init(void);
+void signals_deinit(void);
+
 #endif
index 2556cd63ca0775c097ae337c37e30c818323f30f..7291f469a7e94f2f87302e600104d82c5ac29141 100644 (file)
@@ -106,7 +106,7 @@ static char *get_long_variable_value(const char *key, SERVER_REC *server,
                                     void *item, int *free_ret)
 {
        EXPANDO_FUNC func;
-       char *ret;
+       const char *ret;
        int type;
 
        *free_ret = FALSE;
@@ -124,7 +124,7 @@ static char *get_long_variable_value(const char *key, SERVER_REC *server,
        /* environment variable? */
        ret = g_getenv(key);
        if (ret != NULL)
-               return ret;
+               return (char *) ret;
 
        return NULL;
 }
index 2c23a6ab7510b7de9c4e66231174e47367edc68e..df5525eb4ad08765f979c893e8b99e2f8967b188 100644 (file)
@@ -757,6 +757,17 @@ static void sig_complete_topic(GList **list, WINDOW_REC *window,
        }
 }
 
+static void sig_complete_channel(GList **list, WINDOW_REC *window,
+                                const char *word, const char *line,
+                                int *want_space)
+{
+       g_return_if_fail(list != NULL);
+       g_return_if_fail(word != NULL);
+
+       *list = completion_get_channels(NULL, word);
+       if (*list != NULL) signal_stop();
+}
+
 /* expand \n, \t and \\ */
 static char *expand_escapes(const char *line, SERVER_REC *server,
                            WI_ITEM_REC *item)
@@ -921,6 +932,7 @@ void chat_completion_init(void)
        signal_add("complete command connect", (SIGNAL_FUNC) sig_complete_connect);
        signal_add("complete command server", (SIGNAL_FUNC) sig_complete_connect);
        signal_add("complete command topic", (SIGNAL_FUNC) sig_complete_topic);
+       signal_add("complete command window item move", (SIGNAL_FUNC) sig_complete_channel);
        signal_add("message public", (SIGNAL_FUNC) sig_message_public);
        signal_add("message join", (SIGNAL_FUNC) sig_message_join);
        signal_add("message private", (SIGNAL_FUNC) sig_message_private);
@@ -949,6 +961,7 @@ void chat_completion_deinit(void)
        signal_remove("complete command connect", (SIGNAL_FUNC) sig_complete_connect);
        signal_remove("complete command server", (SIGNAL_FUNC) sig_complete_connect);
        signal_remove("complete command topic", (SIGNAL_FUNC) sig_complete_topic);
+       signal_remove("complete command window item move", (SIGNAL_FUNC) sig_complete_channel);
        signal_remove("message public", (SIGNAL_FUNC) sig_message_public);
        signal_remove("message join", (SIGNAL_FUNC) sig_message_join);
        signal_remove("message private", (SIGNAL_FUNC) sig_message_private);
index f10fbb6dec0414866ecd35da3df8d0607e1eae9f..99046b9f3e073178ca084eb91c0cd860063eb0c4 100644 (file)
@@ -267,7 +267,8 @@ GList *filename_complete(const char *path, const char *default_path)
         GList *list;
        DIR *dirp;
        struct dirent *dp;
-       char *realpath, *dir, *basename, *name;
+       const char *basename;
+       char *realpath, *dir, *name;
        int len;
 
        g_return_val_if_fail(path != NULL, NULL);
@@ -744,6 +745,7 @@ void completion_init(void)
        signal_add_first("complete erase", (SIGNAL_FUNC) sig_complete_erase);
        signal_add("complete command set", (SIGNAL_FUNC) sig_complete_set);
        signal_add("complete command toggle", (SIGNAL_FUNC) sig_complete_toggle);
+       signal_add("complete command load", (SIGNAL_FUNC) sig_complete_filename);
        signal_add("complete command cat", (SIGNAL_FUNC) sig_complete_filename);
        signal_add("complete command save", (SIGNAL_FUNC) sig_complete_filename);
        signal_add("complete command reload", (SIGNAL_FUNC) sig_complete_filename);
@@ -762,6 +764,7 @@ void completion_deinit(void)
        signal_remove("complete erase", (SIGNAL_FUNC) sig_complete_erase);
        signal_remove("complete command set", (SIGNAL_FUNC) sig_complete_set);
        signal_remove("complete command toggle", (SIGNAL_FUNC) sig_complete_toggle);
+       signal_remove("complete command load", (SIGNAL_FUNC) sig_complete_filename);
        signal_remove("complete command cat", (SIGNAL_FUNC) sig_complete_filename);
        signal_remove("complete command save", (SIGNAL_FUNC) sig_complete_filename);
        signal_remove("complete command reload", (SIGNAL_FUNC) sig_complete_filename);
index ec5d395bb14332cbac8b8e136894f024c895b011..27ad4365c0923831a163cdcdc97586bd1e2a19ab 100644 (file)
@@ -67,7 +67,7 @@ static void signal_channel_destroyed(CHANNEL_REC *channel)
        window_item_destroy((WI_ITEM_REC *) channel);
 
        if (channel->joined && !channel->left &&
-           channel->server != NULL) {
+           !channel->server->disconnected) {
                /* kicked out from channel */
                window_bind_add(window, channel->server->tag,
                                channel->name);
@@ -132,21 +132,12 @@ static void cmd_join(const char *data, SERVER_REC *server)
        if (channel == NULL)
                return;
 
+       /* already joined to channel, set it active */
         window = window_item_window(channel);
+       if (window != active_win)
+               window_set_active(window);
 
-       if (window == active_win) {
-               /* channel is in active window, set it active */
-               window_item_set_active(active_win,
-                                      (WI_ITEM_REC *) channel);
-       } else {
-               /* notify user how to move the channel to active
-                  window. this was used to be done automatically
-                  but it just confused everyone who did it
-                  accidentally */
-               printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
-                                  TXT_CHANNEL_MOVE_NOTIFY, channel->name,
-                                  window->refnum);
-       }
+       window_item_set_active(active_win, (WI_ITEM_REC *) channel);
 }
 
 static void cmd_wjoin_post(const char *data)
index 89c17c7fc6b55c95d0e45fbc2c81c23b6e0a4244..f356aa287588d3898c914fbbc3c3ac2131af2615 100644 (file)
@@ -240,7 +240,7 @@ void fe_common_core_deinit(void)
         fe_queries_deinit();
 
        fe_messages_deinit();
-       fe_ignore_messages_init();
+       fe_ignore_messages_deinit();
 
         theme_unregister();
        themes_deinit();
@@ -269,7 +269,7 @@ void glog_func(const char *log_domain, GLogLevelFlags log_level,
        }
 
        if (windows == NULL)
-               fprintf(stderr, "GLib %s: %s", reason, message);
+               fprintf(stderr, "GLib %s: %s\n", reason, message);
        else {
                printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
                            TXT_GLIB_ERROR, reason, message);
index 033e6be616499ef016b5cfa52815aae7058f1990..4b7c9ae0c98c640299e7ae37ec90b6ecada02028 100644 (file)
@@ -67,8 +67,7 @@ static EXEC_WI_REC *exec_wi_create(WINDOW_REC *window, PROCESS_REC *rec)
        item = g_new0(EXEC_WI_REC, 1);
        item->type = module_get_uniq_id_str("WINDOW ITEM TYPE", "EXEC");
         item->destroy = (void (*) (WI_ITEM_REC *)) exec_wi_destroy;
-       item->name = rec->name != NULL ?
-               g_strdup_printf("%%%s", rec->name) :
+       item->name = rec->name != NULL ? g_strdup(rec->name) :
                g_strdup_printf("%%%d", rec->id);
 
        item->createtime = time(NULL);
@@ -406,7 +405,7 @@ static void handle_exec(const char *args, GHashTable *optlist,
                return;
 
         /* common options */
-       target_channel = target_nick = FALSE;
+        target_channel = target_nick = FALSE;
        if (g_hash_table_lookup(optlist, "out") != NULL) {
                 /* redirect output to active channel/query */
                if (item == NULL)
@@ -498,6 +497,7 @@ static void handle_exec(const char *args, GHashTable *optlist,
         rec->args = g_strdup(args);
        rec->notice = notice;
         rec->silent = g_hash_table_lookup(optlist, "-") != NULL;
+        rec->quiet = g_hash_table_lookup(optlist, "quiet") != NULL;
        rec->name = g_strdup(g_hash_table_lookup(optlist, "name"));
 
        level = g_hash_table_lookup(optlist, "level");
@@ -572,6 +572,9 @@ static void sig_exec_input(PROCESS_REC *rec, const char *text)
        SERVER_REC *server;
         char *str;
 
+       if (rec->quiet)
+               return;
+
         item = NULL;
        server = NULL;
 
@@ -620,7 +623,7 @@ static void event_text(const char *data, SERVER_REC *server, EXEC_WI_REC *item)
 void fe_exec_init(void)
 {
        command_bind("exec", NULL, (SIGNAL_FUNC) cmd_exec);
-       command_set_options("exec", "!- interactive nosh +name out +msg +notice +in window close +level");
+       command_set_options("exec", "!- interactive nosh +name out +msg +notice +in window close +level quiet");
 
         signal_exec_input = signal_get_uniq_id("exec input");
         signal_add("pidwait", (SIGNAL_FUNC) sig_pidwait);
index a3b7edee1defb5a5fc61abacb0d8a01e887a0b18..606b230211fd2db26a574abb416f8526d3cfc8b9 100644 (file)
@@ -38,6 +38,7 @@ struct PROCESS_REC {
        unsigned int shell:1; /* start the program via /bin/sh */
        unsigned int notice:1; /* send text with /notice, not /msg if target is set */
        unsigned int silent:1; /* don't print "process exited with level xx" */
+       unsigned int quiet:1; /* don't print process output at all */
        unsigned int target_channel:1; /* target is a channel */
        unsigned int target_nick:1; /* target is a nick */
 };
index 4b4e4db4f758776a561bdc1cd9324b8354f604b8..481301039f2bf4f0203826691831394666fb6ee6 100644 (file)
@@ -396,7 +396,7 @@ static void sig_message_kick(SERVER_REC *server, const char *channel,
                             const char *address, const char *reason)
 {
        printformat(server, channel, MSGLEVEL_KICKS,
-                   TXT_KICK, nick, channel, kicker, reason);
+                   TXT_KICK, nick, channel, kicker, reason, address);
 }
 
 static void print_nick_change_channel(SERVER_REC *server, const char *channel,
@@ -415,7 +415,7 @@ static void print_nick_change_channel(SERVER_REC *server, const char *channel,
 
        printformat(server, channel, level,
                    ownnick ? TXT_YOUR_NICK_CHANGED : TXT_NICK_CHANGED,
-                   oldnick, newnick, channel);
+                   oldnick, newnick, channel, address);
 }
 
 static void print_nick_change(SERVER_REC *server, const char *newnick,
@@ -449,7 +449,8 @@ static void print_nick_change(SERVER_REC *server, const char *newnick,
 
        if (!msgprint && ownnick) {
                printformat(server, NULL, MSGLEVEL_NICKS,
-                           TXT_YOUR_NICK_CHANGED, oldnick, newnick, "");
+                           TXT_YOUR_NICK_CHANGED, oldnick, newnick, "",
+                           address);
        }
 }
 
@@ -466,7 +467,8 @@ static void sig_message_own_nick(SERVER_REC *server, const char *newnick,
                print_nick_change(server, newnick, oldnick, address, TRUE);
        else {
                printformat(server, NULL, MSGLEVEL_NICKS,
-                           TXT_YOUR_NICK_CHANGED, oldnick, newnick, "");
+                           TXT_YOUR_NICK_CHANGED, oldnick, newnick, "",
+                           address);
        }
 }
 
@@ -477,7 +479,7 @@ static void sig_message_invite(SERVER_REC *server, const char *channel,
 
        str = show_lowascii(channel);
        printformat(server, NULL, MSGLEVEL_INVITES,
-                   TXT_INVITE, nick, str);
+                   TXT_INVITE, nick, str, address);
        g_free(str);
 }
 
@@ -487,7 +489,7 @@ static void sig_message_topic(SERVER_REC *server, const char *channel,
 {
        printformat(server, channel, MSGLEVEL_TOPICS,
                    *topic != '\0' ? TXT_NEW_TOPIC : TXT_TOPIC_UNSET,
-                   nick, channel, topic);
+                   nick, channel, topic, address);
 }
 
 static int printnick_exists(NICK_REC *first, NICK_REC *ignore,
index 1ea056e92340856136d5ac4fac3c96c679432116..c6bfaef24fd1e1e00cf757d2a07356159ef54579 100644 (file)
@@ -98,6 +98,10 @@ static void signal_query_destroyed(QUERY_REC *query)
 
        if (!query->unwanted)
                window_auto_destroy(window);
+       else {
+               /* eg. connection lost to dcc chat */
+               window_bind_add(window, query->server->tag, query->name);
+       }
 }
 
 static void signal_query_server_changed(QUERY_REC *query)
@@ -123,7 +127,8 @@ static void signal_query_nick_changed(QUERY_REC *query, const char *oldnick)
        /* don't print the nick change message if only the case was changed */
        if (g_strcasecmp(query->name, oldnick) != 0) {
                printformat_dest(&dest,  TXT_NICK_CHANGED, oldnick,
-                                query->name, query->name);
+                                query->name, query->name,
+                                query->address == NULL ? "" : query->address);
        }
 
        signal_emit("window item changed", 2,
@@ -247,22 +252,12 @@ static void cmd_query(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
                query = CHAT_PROTOCOL(server)->
                        query_create(server->tag, nick, FALSE);
        else {
-               /* query already exists */
+               /* query already exists, set it active */
                WINDOW_REC *window = window_item_window(query);
 
-               if (window == active_win) {
-                        /* query is in active window, set it active */
-                       window_item_set_active(active_win,
-                                              (WI_ITEM_REC *) query);
-               } else {
-                       /* notify user how to move the query to active
-                          window. this was used to be done automatically
-                          but it just confused everyone who did it
-                          accidentally */
-                       printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
-                                          TXT_QUERY_MOVE_NOTIFY, query->name,
-                                          window->refnum);
-               }
+               if (window != active_win)
+                       window_set_active(window);
+               window_item_set_active(active_win, (WI_ITEM_REC *) query);
        }
 
        if (g_hash_table_lookup(optlist, "window") != NULL) {
index 2370facb239552247a1f1c926c627935141bc0ea..af8e4297e9fe3fe5b1f2b9061b4df521cbf461b2 100644 (file)
@@ -109,9 +109,10 @@ void window_destroy(WINDOW_REC *window)
        window->destroying = TRUE;
        windows = g_slist_remove(windows, window);
 
-       if (active_win == window && windows != NULL) {
-                active_win = NULL; /* it's corrupted */
-               window_set_active(windows->data);
+       if (active_win == window) {
+               active_win = NULL; /* it's corrupted */
+               if (windows != NULL)
+                       window_set_active(windows->data);
        }
 
        while (window->items != NULL)
@@ -160,8 +161,8 @@ void window_set_active(WINDOW_REC *window)
 
 void window_change_server(WINDOW_REC *window, void *server)
 {
-        if (server != NULL && SERVER(server)->disconnected)
-                return;
+       if (server != NULL && SERVER(server)->disconnected)
+               return;
 
        window->active_server = server;
        signal_emit("window server changed", 2, window, server);
@@ -194,7 +195,7 @@ void window_set_refnum(WINDOW_REC *window, int refnum)
 void window_set_name(WINDOW_REC *window, const char *name)
 {
        g_free_not_null(window->name);
-       window->name = g_strdup(name);
+       window->name = name == NULL || *name == '\0' ? NULL : g_strdup(name);
 
        signal_emit("window name changed", 1, window);
 }
@@ -338,23 +339,11 @@ WINDOW_REC *window_find_item(SERVER_REC *server, const char *name)
 
        item = server == NULL ? NULL :
                window_item_find(server, name);
-       if (item == NULL && server == NULL) {
+       if (item == NULL) {
                /* not found from the active server - any server? */
                item = window_item_find(NULL, name);
        }
 
-       if (item == NULL) {
-               char *chan;
-
-               /* still nothing? maybe user just left the # in front of
-                  channel, try again with it.. */
-               chan = g_strdup_printf("#%s", name);
-               item = server == NULL ? NULL :
-                       window_item_find(server, chan);
-               if (item == NULL) item = window_item_find(NULL, chan);
-               g_free(chan);
-       }
-
        if (item == NULL)
                return 0;
 
index e014583c617e61ebbf0fc775cdc86db2c292b215..6941391e78c6cb7b7bddfdcb4f1b142676139963 100644 (file)
@@ -169,6 +169,10 @@ int format_expand_styles(GString *out, const char **format, int *flags)
                g_string_append_c(out, 4);
                g_string_append_c(out, FORMAT_STYLE_CLRTOEOL);
                break;
+       case '#':
+               g_string_append_c(out, 4);
+               g_string_append_c(out, FORMAT_STYLE_MONOSPACE);
+               break;
        case '[':
                /* code */
                 format_expand_code(format, out, flags);
@@ -224,7 +228,7 @@ void format_read_arglist(va_list va, FORMAT_REC *format,
                case FORMAT_STRING:
                        arglist[num] = (char *) va_arg(va, char *);
                        if (arglist[num] == NULL) {
-                               g_warning("format_read_arglist() : parameter %d is NULL", num);
+                               g_warning("format_read_arglist(%s) : parameter %d is NULL", format->tag, num);
                                arglist[num] = "";
                        }
                        break;
@@ -703,7 +707,7 @@ void format_newline(WINDOW_REC *window)
        signal_emit_id(signal_gui_print_text, 6, window,
                       GINT_TO_POINTER(-1), GINT_TO_POINTER(-1),
                       GINT_TO_POINTER(GUI_PRINT_FLAG_NEWLINE),
-                      "", GINT_TO_POINTER(-1));
+                      "", NULL);
 }
 
 /* parse ANSI color string */
@@ -956,7 +960,7 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
                                       GINT_TO_POINTER(fgcolor),
                                       GINT_TO_POINTER(bgcolor),
                                       GINT_TO_POINTER(flags), str,
-                                      dest->level);
+                                      dest);
                        flags &= ~(GUI_PRINT_FLAG_INDENT|GUI_PRINT_FLAG_CLRTOEOL);
                }
 
@@ -997,6 +1001,9 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
                        case FORMAT_STYLE_REVERSE:
                                flags ^= GUI_PRINT_FLAG_REVERSE;
                                break;
+                       case FORMAT_STYLE_MONOSPACE:
+                               flags ^= GUI_PRINT_FLAG_MONOSPACE;
+                               break;
                        case FORMAT_STYLE_INDENT:
                                flags |= GUI_PRINT_FLAG_INDENT;
                                break;
@@ -1009,13 +1016,13 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
                                signal_emit_id(signal_gui_print_text, 6,
                                               dest->window, NULL, NULL,
                                               GINT_TO_POINTER(GUI_PRINT_FLAG_INDENT_FUNC),
-                                              str, start, dest->level);
+                                              str, start, dest);
                                break;
                        }
                        case FORMAT_STYLE_DEFAULTS:
                                 fgcolor = theme->default_color;
                                bgcolor = -1;
-                               flags &= GUI_PRINT_FLAG_INDENT;
+                               flags &= GUI_PRINT_FLAG_INDENT|GUI_PRINT_FLAG_MONOSPACE;
                                break;
                        case FORMAT_STYLE_CLRTOEOL:
                                 break;
@@ -1056,7 +1063,7 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
                        /* remove all styling */
                        fgcolor = theme->default_color;
                        bgcolor = -1;
-                       flags &= GUI_PRINT_FLAG_INDENT;
+                       flags &= GUI_PRINT_FLAG_INDENT|GUI_PRINT_FLAG_MONOSPACE;
                        break;
                case 22:
                        /* reverse */
index 4d459c1cf89c526506d9844745a317f0a2474c7c..7dbdd90423ff0860bd773fa40194acc607d6a604 100644 (file)
@@ -13,6 +13,7 @@
 #define GUI_PRINT_FLAG_INDENT_FUNC   0x0040
 #define GUI_PRINT_FLAG_NEWLINE       0x0080
 #define GUI_PRINT_FLAG_CLRTOEOL      0x0100
+#define GUI_PRINT_FLAG_MONOSPACE     0x0200
 
 #define MAX_FORMAT_PARAMS 10
 #define DEFAULT_FORMAT_ARGLIST_SIZE 200
@@ -42,7 +43,7 @@ struct _FORMAT_REC {
 #define PRINT_FLAG_SET_SERVERTAG       0x0010
 #define PRINT_FLAG_UNSET_SERVERTAG     0x0020
 
-typedef struct {
+typedef struct _TEXT_DEST_REC {
        WINDOW_REC *window;
        SERVER_REC *server;
         const char *server_tag; /* if server is non-NULL, must be server->tag */
@@ -131,6 +132,7 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text);
 #define FORMAT_STYLE_INDENT_FUNC (0x06 + FORMAT_STYLE_SPECIAL)
 #define FORMAT_STYLE_DEFAULTS  (0x07 + FORMAT_STYLE_SPECIAL)
 #define FORMAT_STYLE_CLRTOEOL  (0x08 + FORMAT_STYLE_SPECIAL)
+#define FORMAT_STYLE_MONOSPACE (0x09 + FORMAT_STYLE_SPECIAL)
 int format_expand_styles(GString *out, const char **format, int *flags);
 
 void formats_init(void);
index 3c0efade7b5d47de73529de8fcecf46e1df03f59..fb1d89fec0f47ac6ee44f4749e3978987978f552 100644 (file)
@@ -44,7 +44,7 @@ static char used_keys[256];
 static GTree *key_states;
 static int key_config_frozen;
 
-struct KEYBOARD_REC {
+struct _KEYBOARD_REC {
        char *key_state; /* the ongoing key combo */
         void *gui_data; /* GUI specific data sent in "key pressed" signal */
 };
@@ -193,7 +193,7 @@ static int expand_combo(const char *start, const char *end, GSList **out)
         KEY_REC *rec;
        KEYINFO_REC *info;
         GSList *tmp, *tmp2, *list, *copy, *newout;
-       char *str;
+       char *str, *p;
 
        if (start == end) {
                /* single key */
@@ -214,10 +214,16 @@ static int expand_combo(const char *start, const char *end, GSList **out)
                if (strcmp(rec->data, str) == 0)
                         list = g_slist_append(list, rec);
        }
-       g_free(str);
 
-       if (list == NULL)
-               return FALSE;
+       if (list == NULL) {
+               /* unknown keycombo - add it as-is, maybe the GUI will
+                  feed it to us as such */
+               for (p = str; *p != '\0'; p++)
+                       expand_out_char(*out, *p);
+               g_free(str);
+               return TRUE;
+       }
+       g_free(str);
 
        if (list->next == NULL) {
                 /* only one way to generate the combo, good */
@@ -563,6 +569,9 @@ int key_pressed(KEYBOARD_REC *keyboard, const char *key)
                 g_strconcat(keyboard->key_state, "-", key, NULL);
        g_free_and_null(keyboard->key_state);
 
+#if GLIB_MAJOR_VERSION == 2
+#  define GSearchFunc GCompareFunc
+#endif
        rec = g_tree_search(key_states,
                            (GSearchFunc) key_states_search,
                            combo);
@@ -642,6 +651,8 @@ static void cmd_show_keys(const char *searchkey, int full)
        GSList *info, *key;
         int len;
 
+       printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_HEADER);
+
        len = searchkey == NULL ? 0 : strlen(searchkey);
        for (info = keyinfos; info != NULL; info = info->next) {
                KEYINFO_REC *rec = info->data;
@@ -651,11 +662,13 @@ static void cmd_show_keys(const char *searchkey, int full)
 
                        if ((len == 0 || g_strncasecmp(rec->key, searchkey, len) == 0) &&
                            (!full || rec->key[len] == '\0')) {
-                               printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_KEY,
+                               printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_LIST,
                                            rec->key, rec->info->id, rec->data == NULL ? "" : rec->data);
                        }
                }
        }
+
+       printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_FOOTER);
 }
 
 /* SYNTAX: BIND [-delete] [<key> [<command> [<data>]]] */
@@ -833,6 +846,11 @@ void keyboard_init(void)
 
 void keyboard_deinit(void)
 {
+       key_unbind("command", (SIGNAL_FUNC) sig_command);
+       key_unbind("key", (SIGNAL_FUNC) sig_key);
+       key_unbind("multi", (SIGNAL_FUNC) sig_multi);
+       key_unbind("nothing", (SIGNAL_FUNC) sig_nothing);
+
        while (keyinfos != NULL)
                keyinfo_remove(keyinfos->data);
        g_hash_table_destroy(keys);
index 9f2652e004e9a0b045e8722585e160fc4a684ef2..c508d53b810b3ac3d4b64e4535b50b1be9b9077b 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "signals.h"
 
-typedef struct KEYBOARD_REC KEYBOARD_REC;
+typedef struct _KEYBOARD_REC KEYBOARD_REC;
 
 typedef struct {
        char *id;
index 690ae73726cbe1c78223e6f4cc11a2c0a9e24000..223eb3accfa50b070578696ebf06d815f93631ed 100644 (file)
@@ -42,28 +42,28 @@ FORMAT_REC fecommon_core_formats[] = {
        { "window_set_immortal", "Window is now immortal", 0 },
        { "window_unset_immortal", "Window isn't immortal anymore", 0 },
        { "window_immortal_error", "Window is immortal, if you really want to close it, say /WINDOW IMMORTAL OFF", 0 },
-       { "windowlist_header", "Ref Name                 Active item     Server          Level", 0 },
-       { "windowlist_line", "$[3]0 %|$[20]1 $[15]2 $[15]3 $4", 5, { 1, 0, 0, 0, 0 } },
+       { "windowlist_header", "%#Ref Name                 Active item     Server          Level", 0 },
+       { "windowlist_line", "%#$[3]0 %|$[20]1 $[15]2 $[15]3 $4", 5, { 1, 0, 0, 0, 0 } },
        { "windowlist_footer", "", 0 },
        { "windows_layout_saved", "Layout of windows is now remembered next time you start irssi", 0 },
        { "windows_layout_reset", "Layout of windows reset to defaults", 0 },
        { "window_info_header", "", 0 },
        { "window_info_footer", "", 0 },
-       { "window_info_refnum", "Window  : {hilight #$0}", 1, { 1 } },
-       { "window_info_refnum_sticky", "Window  : {hilight #$0 (sticky)}", 1, { 1 } },
-       { "window_info_name", "Name    : $0", 1, { 0 } },
-       { "window_info_history", "History : $0", 1, { 0 } },
-       { "window_info_immortal", "Immortal: yes", 0 },
-       { "window_info_size", "Size    : $0x$1", 2, { 1, 1 } },
-       { "window_info_level", "Level   : $0", 1, { 0 } },
-       { "window_info_server", "Server  : $0", 1, { 0 } },
-       { "window_info_server_sticky", "Server  : $0 (sticky)", 1, { 0 } },
-       { "window_info_theme", "Theme   : $0$1", 2, { 0, 0 } },
-       { "window_info_bound_items_header", "Bounds  : {hilight Name                           Server tag}", 0 },
-       { "window_info_bound_item", "        : $[!30]0 $[!15]1 $2", 3, { 0, 0, 0 } },
+       { "window_info_refnum", "%#Window  : {hilight #$0}", 1, { 1 } },
+       { "window_info_refnum_sticky", "%#Window  : {hilight #$0 (sticky)}", 1, { 1 } },
+       { "window_info_name", "%#Name    : $0", 1, { 0 } },
+       { "window_info_history", "%#History : $0", 1, { 0 } },
+       { "window_info_immortal", "%#Immortal: yes", 0 },
+       { "window_info_size", "%#Size    : $0x$1", 2, { 1, 1 } },
+       { "window_info_level", "%#Level   : $0", 1, { 0 } },
+       { "window_info_server", "%#Server  : $0", 1, { 0 } },
+       { "window_info_server_sticky", "%#Server  : $0 (sticky)", 1, { 0 } },
+       { "window_info_theme", "%#Theme   : $0$1", 2, { 0, 0 } },
+       { "window_info_bound_items_header", "%#Bounds  : {hilight Name                           Server tag}", 0 },
+       { "window_info_bound_item", "%#        : $[!30]0 $[!15]1 $2", 3, { 0, 0, 0 } },
        { "window_info_bound_items_footer", "", 0 },
-       { "window_info_items_header", "Items   : {hilight Name                           Server tag}", 0 },
-       { "window_info_item", " $[7]0: $[!30]1 $2", 3, { 0, 0, 0 } },
+       { "window_info_items_header", "%#Items   : {hilight Name                           Server tag}", 0 },
+       { "window_info_item", "%# $[7]0: $[!30]1 $2", 3, { 0, 0, 0 } },
        { "window_info_items_footer", "", 0 },
 
        /* ---- */
@@ -95,34 +95,33 @@ FORMAT_REC fecommon_core_formats[] = {
 
        { "join", "{channick_hilight $0} {chanhost_hilight $1} has joined {channel $2}", 3, { 0, 0, 0 } },
        { "part", "{channick $0} {chanhost $1} has left {channel $2} {reason $3}", 4, { 0, 0, 0, 0 } },
-       { "kick", "{channick $0} was kicked from {channel $1} by {nick $2} {reason $3}", 4, { 0, 0, 0, 0 } },
+       { "kick", "{channick $0} was kicked from {channel $1} by {nick $2} {reason $3}", 5, { 0, 0, 0, 0, 0 } },
        { "quit", "{channick $0} {chanhost $1} has quit {reason $2}", 4, { 0, 0, 0, 0 } },
        { "quit_once", "{channel $3} {channick $0} {chanhost $1} has quit {reason $2}", 4, { 0, 0, 0, 0 } },
-       { "invite", "{nick $0} invites you to {channel $1}", 2, { 0, 0 } },
+       { "invite", "{nick $0} invites you to {channel $1}", 3, { 0, 0, 0 } },
        { "not_invited", "You have not been invited to a channel!", 0 },
-       { "new_topic", "{nick $0} changed the topic of {channel $1} to: $2", 3, { 0, 0, 0 } },
-       { "topic_unset", "Topic unset by {nick $0} on {channel $1}", 2, { 0, 0 } },
-       { "your_nick_changed", "You're now known as {nick $1}", 3, { 0, 0, 0 } },
-       { "nick_changed", "{channick $0} is now known as {channick_hilight $1}", 3, { 0, 0, 0 } },
+       { "new_topic", "{nick $0} changed the topic of {channel $1} to: $2", 4, { 0, 0, 0, 0 } },
+       { "topic_unset", "Topic unset by {nick $0} on {channel $1}", 4, { 0, 0, 0, 0 } },
+       { "your_nick_changed", "You're now known as {nick $1}", 4, { 0, 0, 0, 0 } },
+       { "nick_changed", "{channick $0} is now known as {channick_hilight $1}", 4, { 0, 0, 0, 0 } },
        { "talking_in", "You are now talking in {channel $0}", 1, { 0 } },
        { "not_in_channels", "You are not on any channels", 0 },
        { "current_channel", "Current channel {channel $0}", 1, { 0 } },
        { "names", "{names_users Users {names_channel $0}}", 6, { 0, 1, 1, 1, 1, 1 } },
-       { "names_prefix", "{names_prefix $0}", 1, { 0 } },
+       { "names_prefix", "%#{names_prefix $0}", 1, { 0 } },
         { "names_nick_op", "{names_nick_op $0 $1}", 2, { 0, 0 } },
         { "names_nick_halfop", "{names_nick_halfop $0 $1}", 2, { 0, 0 } },
         { "names_nick_voice", "{names_nick_voice $0 $1}", 2, { 0, 0 } },
         { "names_nick", "{names_nick $0 $1}", 2, { 0, 0 } },
         { "endofnames", "{channel $0}: Total of {hilight $1} nicks {comment {hilight $2} ops, {hilight $3} halfops, {hilight $4} voices, {hilight $5} normal}", 6, { 0, 1, 1, 1, 1, 1 } },
-       { "chanlist_header", "You are on the following channels:", 0 },
-       { "chanlist_line", "{channel $[-10]0} %|+$1 ($2): $3", 4, { 0, 0, 0, 0 } },
+       { "chanlist_header", "%#You are on the following channels:", 0 },
+       { "chanlist_line", "%#{channel $[-10]0} %|+$1 ($2): $3", 4, { 0, 0, 0, 0 } },
        { "chansetup_not_found", "Channel {channel $0} not found", 2, { 0, 0 } },
        { "chansetup_added", "Channel {channel $0} saved", 2, { 0, 0 } },
        { "chansetup_removed", "Channel {channel $0} removed", 2, { 0, 0 } },
-       { "chansetup_header", "Channel         Network    Password   Settings", 0 },
-       { "chansetup_line", "{channel $[15]0} %|$[10]1 $[10]2 $3", 4, { 0, 0, 0, 0 } },
+       { "chansetup_header", "%#Channel         Network    Password   Settings", 0 },
+       { "chansetup_line", "%#{channel $[15]0} %|$[10]1 $[10]2 $3", 4, { 0, 0, 0, 0 } },
        { "chansetup_footer", "", 0 },
-       { "channel_move_notify", "{channel $0} is already joined in window $1, use \"/WINDOW ITEM MOVE $0\" to move it to this window", 2, { 0, 1 } },
 
        /* ---- */
        { NULL, "Messages", 0 },
@@ -149,13 +148,12 @@ FORMAT_REC fecommon_core_formats[] = {
        { "query_stop", "Closing query with {nick $0}", 1, { 0 } },
        { "no_query", "No query with {nick $0}", 1, { 0 } },
        { "query_server_changed", "Query with {nick $0} changed to server {server $1}", 2, { 0, 0 } },
-       { "query_move_notify", "Query with {nick $0} is already created to window $1, use \"/WINDOW ITEM MOVE $0\" to move it to this window", 2, { 0, 1 } },
 
        /* ---- */
        { NULL, "Highlighting", 0 },
 
-       { "hilight_header", "Highlights:", 0 },
-       { "hilight_line", "$[-4]0 $1 $2 $3$4$5", 7, { 1, 0, 0, 0, 0, 0, 0 } },
+       { "hilight_header", "%#Highlights:", 0 },
+       { "hilight_line", "%#$[-4]0 $1 $2 $3$4$5", 7, { 1, 0, 0, 0, 0, 0, 0 } },
        { "hilight_footer", "", 0 },
        { "hilight_not_found", "Highlight not found: $0", 1, { 0 } },
        { "hilight_removed", "Highlight removed: $0", 1, { 0 } },
@@ -166,8 +164,8 @@ FORMAT_REC fecommon_core_formats[] = {
        { "alias_added", "Alias $0 added", 1, { 0 } },
        { "alias_removed", "Alias $0 removed", 1, { 0 } },
        { "alias_not_found", "No such alias: $0", 1, { 0 } },
-       { "aliaslist_header", "Aliases:", 0 },
-       { "aliaslist_line", "$[10]0 $1", 2, { 0, 0 } },
+       { "aliaslist_header", "%#Aliases:", 0 },
+       { "aliaslist_line", "%#$[10]0 $1", 2, { 0, 0 } },
        { "aliaslist_footer", "", 0 },
 
        /* ---- */
@@ -180,8 +178,8 @@ FORMAT_REC fecommon_core_formats[] = {
        { "log_not_open", "Log file {hilight $0} not open", 1, { 0 } },
        { "log_started", "Started logging to file {hilight $0}", 1, { 0 } },
        { "log_stopped", "Stopped logging to file {hilight $0}", 1, { 0 } },
-       { "log_list_header", "Logs:", 0 },
-       { "log_list", "$0 $1: $2 $3$4", 5, { 1, 0, 0, 0, 0, 0 } },
+       { "log_list_header", "%#Logs:", 0 },
+       { "log_list", "%#$0 $1: $2 $3$4", 5, { 1, 0, 0, 0, 0, 0 } },
        { "log_list_footer", "", 0 },
        { "windowlog_file", "Window LOGFILE set to $0", 1, { 0 } },
        { "windowlog_file_logging", "Can't change window's logfile while log is on", 0 },
@@ -191,8 +189,8 @@ FORMAT_REC fecommon_core_formats[] = {
        /* ---- */
        { NULL, "Modules", 0 },
 
-       { "module_header", "Module               Type    Submodules", 0, },
-       { "module_line", "$[!20]0 $[7]1 $2", 3, { 0, 0, 0 } },
+       { "module_header", "%#Module               Type    Submodules", 0, },
+       { "module_line", "%#$[!20]0 $[7]1 $2", 3, { 0, 0, 0 } },
        { "module_footer", "", 0, },
        { "module_already_loaded", "Module {hilight $0/$1} already loaded", 2, { 0, 0 } },
        { "module_not_loaded", "Module {hilight $0/$1} is not loaded", 2, { 0, 0 } },
@@ -239,8 +237,8 @@ FORMAT_REC fecommon_core_formats[] = {
        { "unignored", "Unignored {nick $0}", 1, { 0 } },
        { "ignore_not_found", "{nick $0} is not being ignored", 1, { 0 } },
        { "ignore_no_ignores", "There are no ignores", 0 },
-       { "ignore_header", "Ignorance List:", 0 },
-       { "ignore_line", "$[-4]0 $1: $2 $3 $4", 4, { 1, 0, 0, 0 } },
+       { "ignore_header", "%#Ignorance List:", 0 },
+       { "ignore_line", "%#$[-4]0 $1: $2 $3 $4", 4, { 1, 0, 0, 0 } },
        { "ignore_footer", "", 0 },
 
        /* ---- */
@@ -250,12 +248,14 @@ FORMAT_REC fecommon_core_formats[] = {
        { "unknown_chatnet", "Unknown chat network: $0 (create it with /IRCNET ADD)", 1, { 0 } },
        { "not_toggle", "Value must be either ON, OFF or TOGGLE", 0 },
        { "perl_error", "Perl error: $0", 1, { 0 } },
-       { "bind_key", "$[!20]0 $1 $2", 3, { 0, 0, 0 } },
+       { "bind_header", "%#Key                  Action", 0 },
+       { "bind_list", "%#$[!20]0 $1 $2", 3, { 0, 0, 0 } },
+       { "bind_footer", "", 0 },
        { "bind_unknown_id", "Unknown bind action: $0", 1, { 0 } },
        { "config_saved", "Saved configuration to file $0", 1, { 0 } },
        { "config_reloaded", "Reloaded configuration", 1, { 0 } },
        { "config_modified", "Configuration file was modified since irssi was last started - do you want to overwrite the possible changes?", 1, { 0 } },
-       { "glib_error", "{error GLib $0} $1", 2, { 0, 0 } },
+       { "glib_error", "{error $0} $1", 2, { 0, 0 } },
        { "overwrite_config", "Overwrite config (y/N)?", 0 },
        { "set_title", "[{hilight $0}]", 1, { 0 } },
        { "set_item", "$0 = $1", 2, { 0, 0 } },
index 6ef7043cba25ec2708fe44d0922b421f78bd95dc..e4d744613754fde7cf7cfcac2a98f102006a7f52 100644 (file)
@@ -98,7 +98,6 @@ enum {
        TXT_CHANSETUP_HEADER,
        TXT_CHANSETUP_LINE,
        TXT_CHANSETUP_FOOTER,
-        TXT_CHANNEL_MOVE_NOTIFY,
 
         TXT_FILL_4,
 
@@ -123,7 +122,6 @@ enum {
        TXT_QUERY_STOP,
        TXT_NO_QUERY,
        TXT_QUERY_SERVER_CHANGED,
-        TXT_QUERY_MOVE_NOTIFY,
 
        TXT_FILL_6,
 
@@ -216,7 +214,9 @@ enum {
         TXT_UNKNOWN_CHATNET,
        TXT_NOT_TOGGLE,
        TXT_PERL_ERROR,
-       TXT_BIND_KEY,
+       TXT_BIND_HEADER,
+       TXT_BIND_LIST,
+       TXT_BIND_FOOTER,
        TXT_BIND_UNKNOWN_ID,
        TXT_CONFIG_SAVED,
        TXT_CONFIG_RELOADED,
index 2accad9d558fd3e8aa6b44abc8962203f97220a1..bbe495aa611a5b992a36f8d0f155d2deeee7db70 100644 (file)
@@ -427,7 +427,12 @@ static void cmd_window_server(const char *data)
 
 static void cmd_window_item(const char *data, void *server, WI_ITEM_REC *item)
 {
-       command_runsub("window item", data, server, item);
+        while (*data == ' ') data++;
+
+       if (is_numeric(data, '\0'))
+               signal_emit("command window item goto", 3, data, server, item);
+       else
+               command_runsub("window item", data, server, item);
 }
 
 /* SYNTAX: WINDOW ITEM PREV */
@@ -442,12 +447,20 @@ static void cmd_window_item_next(void)
        window_item_next(active_win);
 }
 
-/* SYNTAX: WINDOW ITEM GOTO <name> */
+/* SYNTAX: WINDOW ITEM GOTO <number>|<name> */
 static void cmd_window_item_goto(const char *data, SERVER_REC *server)
 {
-        WI_ITEM_REC *item;
+       WI_ITEM_REC *item;
+       GSList *tmp;
+
+       if (is_numeric(data, '\0')) {
+               /* change to specified number */
+               tmp = g_slist_nth(active_win->items, atoi(data)-1);
+               item = tmp == NULL ? NULL : tmp->data;
+       } else {
+               item = window_item_find_window(active_win, server, data);
+       }
 
-        item = window_item_find_window(active_win, server, data);
         if (item != NULL)
                 window_item_set_active(active_win, item);
 }
@@ -510,7 +523,8 @@ static void cmd_window_name(const char *data)
 {
        if (window_find_name(data) == NULL)
                window_set_name(active_win, data);
-       else {
+       else if (active_win->name == NULL ||
+                strcmp(active_win->name, data) != 0) {
                printformat_window(active_win, MSGLEVEL_CLIENTERROR,
                                   TXT_WINDOW_NAME_NOT_UNIQUE, data);
        }
index 5d53f1ae177204fe3396bb5a5e4f0fefdbc49e69..a19b2942485661324203a783f456ce52d8827e1d 100644 (file)
@@ -132,36 +132,39 @@ static void sig_layout_restore(void)
        }
 }
 
-static void window_save_items(WINDOW_REC *window, CONFIG_NODE *node)
+static void sig_layout_save_item(WINDOW_REC *window, WI_ITEM_REC *item,
+                                CONFIG_NODE *node)
 {
        CONFIG_NODE *subnode;
-       GSList *tmp;
        const char *type;
 
-       node = config_node_section(node, "items", NODE_TYPE_LIST);
-       for (tmp = window->items; tmp != NULL; tmp = tmp->next) {
-               WI_ITEM_REC *rec = tmp->data;
-               SERVER_REC *server = rec->server;
-
-               type = module_find_id_str("WINDOW ITEM TYPE", rec->type);
-               if (type == NULL) continue;
+       type = module_find_id_str("WINDOW ITEM TYPE", item->type);
+       if (type == NULL)
+               return;
 
-               subnode = config_node_section(node, NULL, NODE_TYPE_BLOCK);
+       subnode = config_node_section(node, NULL, NODE_TYPE_BLOCK);
 
-               iconfig_node_set_str(subnode, "type", type);
-               type = chat_protocol_find_id(rec->chat_type)->name;
-               iconfig_node_set_str(subnode, "chat_type", type);
-               iconfig_node_set_str(subnode, "name", rec->name);
+       iconfig_node_set_str(subnode, "type", type);
+       type = chat_protocol_find_id(item->chat_type)->name;
+       iconfig_node_set_str(subnode, "chat_type", type);
+       iconfig_node_set_str(subnode, "name", item->name);
 
-               if (server != NULL)
-                       iconfig_node_set_str(subnode, "tag", server->tag);
-               else if (IS_QUERY(rec)) {
-                       iconfig_node_set_str(subnode, "tag",
-                                            QUERY(rec)->server_tag);
-               }
+       if (item->server != NULL)
+               iconfig_node_set_str(subnode, "tag", item->server->tag);
+       else if (IS_QUERY(item)) {
+               iconfig_node_set_str(subnode, "tag", QUERY(item)->server_tag);
        }
 }
 
+static void window_save_items(WINDOW_REC *window, CONFIG_NODE *node)
+{
+       GSList *tmp;
+
+       node = config_node_section(node, "items", NODE_TYPE_LIST);
+       for (tmp = window->items; tmp != NULL; tmp = tmp->next)
+               signal_emit("layout save item", 3, window, tmp->data, node);
+}
+
 static void window_save(WINDOW_REC *window, CONFIG_NODE *node)
 {
        char refnum[MAX_INT_STRLEN];
@@ -224,10 +227,12 @@ void windows_layout_init(void)
 {
        signal_add("layout restore item", (SIGNAL_FUNC) sig_layout_restore_item);
        signal_add("layout restore", (SIGNAL_FUNC) sig_layout_restore);
+       signal_add("layout save item", (SIGNAL_FUNC) sig_layout_save_item);
 }
 
 void windows_layout_deinit(void)
 {
        signal_remove("layout restore item", (SIGNAL_FUNC) sig_layout_restore_item);
        signal_remove("layout restore", (SIGNAL_FUNC) sig_layout_restore);
+       signal_remove("layout save item", (SIGNAL_FUNC) sig_layout_save_item);
 }
index 429937a52c1bc79a6b73306267e9967816df7b0d..2d8a8cde009125e00615d83e77389b1b467f22e1 100644 (file)
@@ -231,7 +231,7 @@ static void view_add_eol(TEXT_BUFFER_VIEW_REC *view, LINE_REC **line)
 
 static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor,
                               void *bgcolor, void *pflags,
-                              char *str, void *level)
+                              char *str, TEXT_DEST_REC *dest)
 {
         GUI_WINDOW_REC *gui;
         TEXT_BUFFER_VIEW_REC *view;
@@ -259,7 +259,7 @@ static void sig_gui_print_text(WINDOW_REC *window, void *fgcolor,
                 return;
        }
 
-       lineinfo.level = GPOINTER_TO_INT(level);
+       lineinfo.level = dest == NULL ? 0 : dest->level;
         lineinfo.time = time(NULL);
 
         gui = WINDOW_GUI(window);
index 145273b724e1f83f7df522b4a79873df0e2c29df..c23b42c79d245ca753bfac0e62731d591112d875 100644 (file)
@@ -665,11 +665,11 @@ void gui_readline_init(void)
 
         /* window managing */
        key_bind("previous_window", "Previous window", "^P", NULL, (SIGNAL_FUNC) key_previous_window);
-       key_bind("left_window", "Window in left", "meta-left", NULL, (SIGNAL_FUNC) key_left_window);
        key_bind("next_window", "Next window", "^N", NULL, (SIGNAL_FUNC) key_next_window);
-       key_bind("right_window", "Window in right", "meta-right", NULL, (SIGNAL_FUNC) key_right_window);
        key_bind("upper_window", "Upper window", "meta-up", NULL, (SIGNAL_FUNC) key_upper_window);
        key_bind("lower_window", "Lower window", "meta-down", NULL, (SIGNAL_FUNC) key_lower_window);
+       key_bind("left_window", "Window in left", "meta-left", NULL, (SIGNAL_FUNC) key_left_window);
+       key_bind("right_window", "Window in right", "meta-right", NULL, (SIGNAL_FUNC) key_right_window);
        key_bind("active_window", "Go to next window with the highest activity", "meta-a", NULL, (SIGNAL_FUNC) key_active_window);
        key_bind("next_window_item", "Next channel/query", "^X", NULL, (SIGNAL_FUNC) key_next_window_item);
        key_bind("previous_window_item", "Previous channel/query", NULL, NULL, (SIGNAL_FUNC) key_previous_window_item);
@@ -737,13 +737,17 @@ void gui_readline_deinit(void)
        key_unbind("yank_from_cutbuffer", (SIGNAL_FUNC) key_yank_from_cutbuffer);
        key_unbind("transpose_characters", (SIGNAL_FUNC) key_transpose_characters);
 
+       key_unbind("send_line", (SIGNAL_FUNC) key_send_line);
        key_unbind("word_completion", (SIGNAL_FUNC) key_word_completion);
+       key_unbind("erase_completion", (SIGNAL_FUNC) key_erase_completion);
        key_unbind("check_replaces", (SIGNAL_FUNC) key_check_replaces);
 
        key_unbind("previous_window", (SIGNAL_FUNC) key_previous_window);
        key_unbind("next_window", (SIGNAL_FUNC) key_next_window);
        key_unbind("upper_window", (SIGNAL_FUNC) key_upper_window);
        key_unbind("lower_window", (SIGNAL_FUNC) key_lower_window);
+       key_unbind("left_window", (SIGNAL_FUNC) key_left_window);
+       key_unbind("right_window", (SIGNAL_FUNC) key_right_window);
        key_unbind("active_window", (SIGNAL_FUNC) key_active_window);
        key_unbind("next_window_item", (SIGNAL_FUNC) key_next_window_item);
        key_unbind("previous_window_item", (SIGNAL_FUNC) key_previous_window_item);
index f236d900018ccab5e66bc257b8e3ce1b97ce2330..79e9dc2bb716e6f5a671cf14cb5676ce8f16eed0 100644 (file)
@@ -45,25 +45,25 @@ FORMAT_REC gui_text_formats[] =
        { "window_not_sticky", "Window is not sticky", 0 },
        { "window_set_sticky", "Window set sticky", 0 },
        { "window_unset_sticky", "Window is not sticky anymore", 0 },
-       { "window_info_sticky", "Sticky  : $0", 1, { 0 } },
-       { "window_info_scroll", "Scroll  : $0", 1, { 0 } },
+       { "window_info_sticky", "%#Sticky  : $0", 1, { 0 } },
+       { "window_info_scroll", "%#Scroll  : $0", 1, { 0 } },
        { "window_scroll", "Window scroll mode is now $0", 1, { 0 } },
        { "window_scroll_unknown", "Unknown scroll mode $0, must be ON, OFF or DEFAULT", 1, { 0 } },
 
        /* ---- */
        { NULL, "Statusbars", 0 },
 
-       { "statusbar_list_header", "Name                           Type   Placement Position Visible", 0 },
+       { "statusbar_list_header", "%#Name                           Type   Placement Position Visible", 0 },
        { "statusbar_list_footer", "", 0 },
-       { "statusbar_list", "$[30]0 $[6]1 $[9]2 $[8]3 $4", 5, { 0, 0, 0, 1, 0 } },
-       { "statusbar_info_name", "Statusbar: {hilight $0}", 1, { 0 } },
-       { "statusbar_info_type", "Type     : $0", 1, { 0 } },
-       { "statusbar_info_placement", "Placement: $0", 1, { 0 } },
-       { "statusbar_info_position", "Position : $0", 1, { 1 } },
-       { "statusbar_info_visible", "Visible  : $0", 1, { 0 } },
-       { "statusbar_info_item_header", "Items    : Name                                Priority  Alignment", 0 },
+       { "statusbar_list", "%#$[30]0 $[6]1 $[9]2 $[8]3 $4", 5, { 0, 0, 0, 1, 0 } },
+       { "statusbar_info_name", "%#Statusbar: {hilight $0}", 1, { 0 } },
+       { "statusbar_info_type", "%#Type     : $0", 1, { 0 } },
+       { "statusbar_info_placement", "%#Placement: $0", 1, { 0 } },
+       { "statusbar_info_position", "%#Position : $0", 1, { 1 } },
+       { "statusbar_info_visible", "%#Visible  : $0", 1, { 0 } },
+       { "statusbar_info_item_header", "%#Items    : Name                                Priority  Alignment", 0 },
        { "statusbar_info_item_footer", "", 0 },
-       { "statusbar_info_item_name",  "         : $[35]0 $[9]1 $2", 3, { 0, 1, 0 } },
+       { "statusbar_info_item_name",  "%#         : $[35]0 $[9]1 $2", 3, { 0, 1, 0 } },
        { "statusbar_not_found", "Statusbar doesn't exist: $0", 1, { 0 } },
        { "statusbar_not_found", "Statusbar doesn't exist: $0", 1, { 0 } },
        { "statusbar_item_not_found", "Statusbar item doesn't exist: $0", 1, { 0 } },
index 9d39ede790e8c68bbe83a94df7d975d33e2ba364..5ad869980da7308b41383a3713b5788a409323d1 100644 (file)
@@ -859,8 +859,11 @@ static void statusbar_item_default_signals(SBAR_ITEM_REC *item)
                                 func = NULL;
                                 break;
                        }
-                        if (func != NULL)
-                               signal_add_to_id(MODULE_NAME, 1, *pos, func);
+                       if (func != NULL) {
+                               signal_add_full_id(MODULE_NAME,
+                                                  SIGNAL_PRIORITY_DEFAULT,
+                                                  *pos, func, NULL);
+                       }
                }
 
                if (g_slist_find(list, item) == NULL)
@@ -911,10 +914,10 @@ SBAR_ITEM_REC *statusbar_item_create(STATUSBAR_REC *bar,
 
 static void statusbar_signal_remove(int signal_id)
 {
-       signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_item);
-       signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_server);
-       signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_window);
-       signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_window_item);
+       signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_item, NULL);
+       signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_server, NULL);
+       signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_window, NULL);
+       signal_remove_id(signal_id, (SIGNAL_FUNC) statusbar_update_window_item, NULL);
 }
 
 static void statusbar_item_remove_signal(SBAR_ITEM_REC *item, int signal_id)
index 54a02a6b4caa000aab5ef597fb233a5a92f538d7..ddb00441d0b81204d5f22cc2391bc7072cea9cae 100644 (file)
@@ -376,7 +376,7 @@ static void term_printed_text(int count)
        vcx += count;
        while (vcx >= term_width) {
                vcx -= term_width;
-               if (vcy < term_height) vcy++;
+               if (vcy < term_height-1) vcy++;
                if (vcx > 0) term_lines_empty[vcy] = FALSE;
        }
 }
index da75a5a80a527279fab29e906aff27da309448cd..62f17f0d0e4e97e6d30827f523510f82c05a1704 100644 (file)
@@ -275,6 +275,6 @@ void textbuffer_reformat_deinit(void)
        g_string_free(format, TRUE);
 
        signal_remove("print format", (SIGNAL_FUNC) sig_print_format);
-       signal_remove("print text finished", (SIGNAL_FUNC) sig_gui_printtext_finished);
+       signal_remove("gui print text finished", (SIGNAL_FUNC) sig_gui_printtext_finished);
        signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
 }
index 4db742c044e29ebc29c6ae573f482bab21505784..0fb93efb58662dbd86713ba21b11463297e15707 100644 (file)
@@ -15,7 +15,7 @@ void perl_signal_add_hash(int priority, SV *sv)
         hv = hvref(sv);
        hv_iterinit(hv);
        while ((he = hv_iternext(hv)) != NULL)
-                perl_signal_add_to(hv_iterkey(he, &len), HeVAL(he), priority);
+                perl_signal_add_full(hv_iterkey(he, &len), HeVAL(he), priority);
 }
 
 static void perl_command_bind_add_hash(int priority, SV *sv, char *category)
@@ -76,15 +76,35 @@ CODE:
        }
        signal_emit(signal, items-1, p[0], p[1], p[2], p[3], p[4], p[5]);
 
+void
+signal_continue(...)
+CODE:
+       void *p[SIGNAL_MAX_ARGUMENTS];
+       int n;
+
+       memset(p, 0, sizeof(p));
+       for (n = 0; n < items && n < SIGNAL_MAX_ARGUMENTS; n++) {
+               if (SvPOKp(ST(n)))
+                       p[n] = SvPV(ST(n), PL_na);
+               else if (irssi_is_ref_object(ST(n)))
+                       p[n] = irssi_ref_object(ST(n));
+               else if (SvROK(ST(n)))
+                       p[n] = (void *) SvIV((SV*)SvRV(ST(n)));
+               else
+                       p[n] = NULL;
+       }
+       signal_continue(items, p[0], p[1], p[2], p[3], p[4], p[5]);
+
 void
 signal_add(...)
 CODE:
        if (items != 1 && items != 2)
                croak("Usage: Irssi::signal_add(signal, func)");
        if (items == 2)
-               perl_signal_add((char *)SvPV(ST(0),PL_na), ST(1));
+               perl_signal_add_full((char *)SvPV(ST(0),PL_na), ST(1),
+                                    SIGNAL_PRIORITY_DEFAULT);
        else
-               perl_signal_add_hash(1, ST(0));
+               perl_signal_add_hash(SIGNAL_PRIORITY_DEFAULT, ST(0));
 
 void
 signal_add_first(...)
@@ -92,9 +112,10 @@ CODE:
        if (items != 1 && items != 2)
                croak("Usage: Irssi::signal_add_first(signal, func)");
        if (items == 2)
-               perl_signal_add_first((char *)SvPV(ST(0),PL_na), ST(1));
+               perl_signal_add_full((char *)SvPV(ST(0),PL_na), ST(1),
+                                    SIGNAL_PRIORITY_HIGH);
        else
-               perl_signal_add_hash(0, ST(0));
+               perl_signal_add_hash(SIGNAL_PRIORITY_HIGH, ST(0));
 
 void
 signal_add_last(...)
@@ -102,9 +123,41 @@ CODE:
        if (items != 1 && items != 2)
                croak("Usage: Irssi::signal_add_last(signal, func)");
        if (items == 2)
-               perl_signal_add_last((char *)SvPV(ST(0),PL_na), ST(1));
+               perl_signal_add_full((char *)SvPV(ST(0),PL_na), ST(1),
+                                    SIGNAL_PRIORITY_LOW);
        else
-               perl_signal_add_hash(2, ST(0));
+               perl_signal_add_hash(SIGNAL_PRIORITY_LOW, ST(0));
+
+void
+signal_add_priority(...)
+CODE:
+       if (items != 2 && items != 3)
+               croak("Usage: Irssi::signal_add_priority(signal, func, priority)");
+       if (items == 3)
+               perl_signal_add_full((char *)SvPV(ST(0),PL_na), ST(1), SvIV(ST(2)));
+       else
+               perl_signal_add_hash(SvIV(ST(0)), ST(1));
+
+int
+SIGNAL_PRIORITY_LOW()
+CODE:
+       RETVAL = SIGNAL_PRIORITY_LOW;
+OUTPUT:
+       RETVAL
+
+int
+SIGNAL_PRIORITY_DEFAULT()
+CODE:
+       RETVAL = SIGNAL_PRIORITY_DEFAULT;
+OUTPUT:
+       RETVAL
+
+int
+SIGNAL_PRIORITY_HIGH()
+CODE:
+       RETVAL = SIGNAL_PRIORITY_HIGH;
+OUTPUT:
+       RETVAL
 
 void
 signal_remove(signal, func)
@@ -136,7 +189,12 @@ timeout_add(msecs, func, data)
        SV *func
        SV *data
 CODE:
-       RETVAL = perl_timeout_add(msecs, func, data);
+       if (msecs < 10) {
+               croak("Irssi::timeout() : msecs must be >= 10");
+               RETVAL = -1;
+       } else {
+               RETVAL = perl_timeout_add(msecs, func, data);
+       }
 OUTPUT:
        RETVAL
 
@@ -399,17 +457,17 @@ PPCODE:
 void
 command_bind_first(...)
 CODE:
-       handle_command_bind(0, items, ST(0), ST(1), ST(2));
+       handle_command_bind(SIGNAL_PRIORITY_HIGH, items, ST(0), ST(1), ST(2));
 
 void
 command_bind(...)
 CODE:
-       handle_command_bind(1, items, ST(0), ST(1), ST(2));
+       handle_command_bind(SIGNAL_PRIORITY_DEFAULT, items, ST(0), ST(1), ST(2));
 
 void
 command_bind_last(...)
 CODE:
-       handle_command_bind(2, items, ST(0), ST(1), ST(2));
+       handle_command_bind(SIGNAL_PRIORITY_LOW, items, ST(0), ST(1), ST(2));
 
 void
 command_runsub(cmd, data, server, item)
index eb1d367b88a2451392d3a5965cd27f05c78b8537..a9f93bf0da84220fe0c45df4be2b88874a110d76 100644 (file)
@@ -120,7 +120,9 @@ sub EXPORT_ALL () {
       push @EXPORT_OK, $_ if /[a-z]/ && defined *{$_}{CODE};
     }
   }
-  select CLIENTCRAP;
+
+  tie *DEFAULT, __PACKAGE__, MSGLEVEL_CLIENTCRAP();
+  select DEFAULT;
 }
 
 sub in_irssi {
index 5c2e1c66c57248dd5f6451d5d2f61757bf0c901d..8840e4378b3ca9cc4decef57f61dcaaa4e408707 100644 (file)
@@ -32,8 +32,8 @@ FORMAT_REC feperl_formats[] = {
        { "script_loaded", "Loaded script {hilight $0}", 2, { 0, 0 } },
        { "script_unloaded", "Unloaded script {hilight $0}", 1, { 0 } },
        { "no_scripts_loaded", "No scripts are loaded", 0 },
-       { "script_list_header", "Loaded scripts:", 0 },
-       { "script_list_line", "$[!15]0 $1", 2, { 0, 0 } },
+       { "script_list_header", "%#Loaded scripts:", 0 },
+       { "script_list_line", "%#$[!15]0 $1", 2, { 0, 0 } },
        { "script_list_footer", "", 0 },
        { "script_error", "{error Error in script {hilight $0}:}", 1, { 0 } },
 
index cb5f09877adde79a217e4c6bab4c1daeafc85cbd..72fc557c98f0d1f077cfac93c9e269c1e64b6258 100644 (file)
@@ -329,8 +329,8 @@ void perl_window_item_fill_hash(HV *hv, WI_ITEM_REC *item)
        hv_store(hv, "name", 4, new_pv(item->name), 0);
 
        hv_store(hv, "createtime", 10, newSViv(item->createtime), 0);
-       hv_store(hv, "data_level", 8, newSViv(item->data_level), 0);
-       hv_store(hv, "hilight_color", 10, new_pv(item->hilight_color), 0);
+       hv_store(hv, "data_level", 10, newSViv(item->data_level), 0);
+       hv_store(hv, "hilight_color", 13, new_pv(item->hilight_color), 0);
 }
 
 void perl_channel_fill_hash(HV *hv, CHANNEL_REC *channel)
@@ -369,6 +369,7 @@ void perl_query_fill_hash(HV *hv, QUERY_REC *query)
 
        perl_window_item_fill_hash(hv, (WI_ITEM_REC *) query);
 
+       hv_store(hv, "last_unread_msg", 15, newSViv(query->last_unread_msg), 0);
        hv_store(hv, "address", 7, new_pv(query->address), 0);
        hv_store(hv, "server_tag", 10, new_pv(query->server_tag), 0);
        hv_store(hv, "unwanted", 8, newSViv(query->unwanted), 0);
@@ -425,7 +426,7 @@ static void perl_ignore_fill_hash(HV *hv, IGNORE_REC *ignore)
 
        hv_store(hv, "level", 5, newSViv(ignore->level), 0);
 
-       hv_store(hv, "exception", 6, newSViv(ignore->exception), 0);
+       hv_store(hv, "exception", 9, newSViv(ignore->exception), 0);
        hv_store(hv, "regexp", 6, newSViv(ignore->regexp), 0);
        hv_store(hv, "fullword", 8, newSViv(ignore->fullword), 0);
 }
index fc888cf2d2c49c91432a26fa431c72ca41aeb367..05003c0fb2885e25e606e8f0d196d50c60e1efe1 100644 (file)
@@ -40,6 +40,7 @@ static PERL_SIGNAL_ARGS_REC perl_signal_args[] =
     { "query created", { "iobject", "int", NULL } },
     { "query destroyed", { "iobject", NULL } },
     { "query nick changed", { "iobject", "string", NULL } },
+    { "window item name changed", { "iobject", NULL } },
     { "query address changed", { "iobject", NULL } },
     { "query server changed", { "iobject", "iobject", NULL } },
     { "rawlog", { "RAWIrssi::Log", "string", NULL } },
@@ -76,8 +77,8 @@ static PERL_SIGNAL_ARGS_REC perl_signal_args[] =
     { "massjoin", { "iobject", "gslist_iobject", NULL } },
     { "ban new", { "iobject", "Irssi::Irc::Ban", NULL } },
     { "ban remove", { "iobject", "Irssi::Irc::Ban", NULL } },
-    { "channel mode changed", { "iobject", NULL } },
-    { "nick mode changed", { "iobject", "iobject", NULL } },
+    { "channel mode changed", { "iobject", "string", NULL } },
+    { "nick mode changed", { "iobject", "iobject", "string", NULL } },
     { "user mode changed", { "iobject", "string", NULL } },
     { "away mode changed", { "iobject", NULL } },
     { "netsplit server new", { "iobject", "NETSPLIT_iobject", NULL } },
@@ -119,7 +120,7 @@ static PERL_SIGNAL_ARGS_REC perl_signal_args[] =
     { "notifylist left", { "iobject", "string", "string", "string", "string", "string", NULL } },
     { "proxy client connected", { "CLIENT_REC", NULL } },
     { "proxy client disconnected", { "CLIENT_REC", NULL } },
-    { "gui print text", { "Irssi::UI::Window", "int", "int", "int", "string", "int", NULL } },
+    { "gui print text", { "Irssi::UI::Window", "int", "int", "int", "string", "Irssi::UI::TextDest", NULL } },
     { "gui print text finished", { "Irssi::UI::Window", NULL } },
     { "complete word", { "glistptr_char*", "Irssi::UI::Window", "string", "string", "intptr", NULL } },
     { "exec new", { "Irssi::UI::Process", NULL } },
@@ -167,6 +168,7 @@ static PERL_SIGNAL_ARGS_REC perl_signal_args[] =
     { "message irc notice", { "iobject", "string", "string", "string", "string", NULL } },
     { "message irc own_ctcp", { "iobject", "string", "string", "string", NULL } },
     { "message irc ctcp", { "iobject", "string", "string", "string", "string", "string", NULL } },
+    { "message irc mode", { "iobject", "string", "string", "string", "string", NULL } },
     { "message dcc own", { "siobject", "string", NULL } },
     { "message dcc own_action", { "siobject", "string", NULL } },
     { "message dcc own_ctcp", { "siobject", "string", "string", NULL } },
index eb3a8b48419bfbe4b1c2aa5c7eaad43621c351b8..3c423a648e48a4de7902f8d41696c51030f66adc 100644 (file)
@@ -33,9 +33,7 @@ typedef struct {
         PERL_SCRIPT_REC *script;
        int signal_id;
        char *signal;
-
        SV *func;
-       int priority;
 } PERL_SIGNAL_REC;
 
 typedef struct {
@@ -45,7 +43,7 @@ typedef struct {
 
 #include "perl-signals-list.h"
 
-static GHashTable *signals[3];
+static GHashTable *signals;
 static GHashTable *perl_signal_args_hash;
 static GSList *perl_signal_args_partial;
 
@@ -208,103 +206,72 @@ static void perl_call_signal(PERL_SCRIPT_REC *script, SV *func,
        LEAVE;
 }
 
-static void sig_func(int priority, gconstpointer *args)
+static void sig_func(const void *p1, const void *p2,
+                    const void *p3, const void *p4,
+                    const void *p5, const void *p6)
 {
-       GSList **list, *tmp, *next;
-        int signal_id;
-
-        signal_id = signal_get_emitted_id();
-       list = g_hash_table_lookup(signals[priority],
-                                  GINT_TO_POINTER(signal_id));
-       for (tmp = list == NULL ? NULL : *list; tmp != NULL; tmp = next) {
-               PERL_SIGNAL_REC *rec = tmp->data;
+       PERL_SIGNAL_REC *rec;
+       const void *args[6];
 
-                next = tmp->next;
-               perl_call_signal(rec->script, rec->func, signal_id, args);
-               if (signal_is_stopped(signal_id))
-                        break;
-       }
-}
+       args[0] = p1; args[1] = p2; args[2] = p3;
+       args[3] = p4; args[4] = p5; args[5] = p6;
 
-#define SIG_FUNC_DECL(priority, priority_name) \
-static void sig_func_##priority_name(gconstpointer p1, gconstpointer p2, \
-                                    gconstpointer p3, gconstpointer p4, \
-                                    gconstpointer p5, gconstpointer p6) \
-{ \
-       gconstpointer args[6]; \
-        args[0] = p1; args[1] = p2; args[2] = p3; \
-        args[3] = p4; args[4] = p5; args[5] = p6; \
-        sig_func(priority, args); \
+       rec = signal_get_user_data();
+       perl_call_signal(rec->script, rec->func, signal_get_emitted_id(), args);
 }
 
-SIG_FUNC_DECL(0, first);
-SIG_FUNC_DECL(1, default);
-SIG_FUNC_DECL(2, last);
-
-#define priority_get_func(priority) \
-       (priority == 0 ? sig_func_first : \
-       priority == 1 ? sig_func_default : sig_func_last)
-
-#define perl_signal_get_func(rec) \
-       (priority_get_func((rec)->priority))
-
-static void perl_signal_add_to_int(const char *signal, SV *func,
-                                  int priority, int command)
+static void perl_signal_add_full_int(const char *signal, SV *func,
+                                    int priority, int command,
+                                    const char *category)
 {
         PERL_SCRIPT_REC *script;
        PERL_SIGNAL_REC *rec;
-       GHashTable *table;
        GSList **siglist;
        void *signal_idp;
 
         g_return_if_fail(signal != NULL);
         g_return_if_fail(func != NULL);
-        g_return_if_fail(priority >= 0 && priority <= 2);
 
         script = perl_script_find_package(perl_get_package());
         g_return_if_fail(script != NULL);
 
-       if (!command && strncmp(signal, "command ", 8) == 0) {
-               /* we used Irssi::signal_add() instead of
-                  Irssi::command_bind() - oh well, allow this.. */
-               command_bind_to(MODULE_NAME, priority, signal+8, -1,
-                               NULL, priority_get_func(priority));
-                command = TRUE;
-       }
-
        rec = g_new(PERL_SIGNAL_REC, 1);
         rec->script = script;
        rec->signal_id = signal_get_uniq_id(signal);
        rec->signal = g_strdup(signal);
        rec->func = perl_func_sv_inc(func, perl_get_package());
-       rec->priority = priority;
 
-       table = signals[priority];
-       signal_idp = GINT_TO_POINTER(rec->signal_id);
+       if (command || strncmp(signal, "command ", 8) == 0) {
+               /* we used Irssi::signal_add() instead of
+                  Irssi::command_bind() - oh well, allow this.. */
+               command_bind_full(MODULE_NAME, priority, signal+8, -1,
+                                 category, sig_func, rec);
+       } else {
+               signal_add_full_id(MODULE_NAME, priority, rec->signal_id,
+                                  sig_func, rec);
+       }
 
-       siglist = g_hash_table_lookup(table, signal_idp);
+       signal_idp = GINT_TO_POINTER(rec->signal_id);
+       siglist = g_hash_table_lookup(signals, signal_idp);
        if (siglist == NULL) {
                siglist = g_new0(GSList *, 1);
-               g_hash_table_insert(table, signal_idp, siglist);
-
-               if (!command) {
-                       signal_add_to_id(MODULE_NAME, priority, rec->signal_id,
-                                        perl_signal_get_func(rec));
-               }
+               g_hash_table_insert(signals, signal_idp, siglist);
        }
 
        *siglist = g_slist_append(*siglist, rec);
 }
 
-void perl_signal_add_to(const char *signal, SV *func, int priority)
+void perl_signal_add_full(const char *signal, SV *func, int priority)
 {
-        perl_signal_add_to_int(signal, func, priority, FALSE);
+        perl_signal_add_full_int(signal, func, priority, FALSE, NULL);
 }
 
 static void perl_signal_destroy(PERL_SIGNAL_REC *rec)
 {
        if (strncmp(rec->signal, "command ", 8) == 0)
-               command_unbind(rec->signal+8, perl_signal_get_func(rec));
+               command_unbind_full(rec->signal+8, sig_func, rec);
+       else
+               signal_remove_id(rec->signal_id, sig_func, rec);
 
         SvREFCNT_dec(rec->func);
        g_free(rec->signal);
@@ -313,17 +280,10 @@ static void perl_signal_destroy(PERL_SIGNAL_REC *rec)
 
 static void perl_signal_remove_list_one(GSList **siglist, PERL_SIGNAL_REC *rec)
 {
-       void *signal_idp;
-
-       g_return_if_fail(rec != NULL);
-
-       signal_idp = GINT_TO_POINTER(rec->signal_id);
-
        *siglist = g_slist_remove(*siglist, rec);
        if (*siglist == NULL) {
-               signal_remove_id(rec->signal_id, perl_signal_get_func(rec));
                g_free(siglist);
-               g_hash_table_remove(signals[rec->priority], signal_idp);
+               g_hash_table_remove(signals, GINT_TO_POINTER(rec->signal_id));
        }
 
         perl_signal_destroy(rec);
@@ -337,8 +297,6 @@ static void perl_signal_remove_list(GSList **list, SV *func)
 {
        GSList *tmp;
 
-       g_return_if_fail(list != NULL);
-
        for (tmp = *list; tmp != NULL; tmp = tmp->next) {
                PERL_SIGNAL_REC *rec = tmp->data;
 
@@ -353,17 +311,15 @@ void perl_signal_remove(const char *signal, SV *func)
 {
        GSList **list;
         void *signal_idp;
-       int n;
 
        signal_idp = GINT_TO_POINTER(signal_get_uniq_id(signal));
+       list = g_hash_table_lookup(signals, signal_idp);
 
-        func = perl_func_sv_inc(func, perl_get_package());
-       for (n = 0; n < sizeof(signals)/sizeof(signals[0]); n++) {
-               list = g_hash_table_lookup(signals[n], signal_idp);
-               if (list != NULL)
-                       perl_signal_remove_list(list, func);
+       if (list != NULL) {
+               func = perl_func_sv_inc(func, perl_get_package());
+               perl_signal_remove_list(list, func);
+               SvREFCNT_dec(func);
        }
-        SvREFCNT_dec(func);
 }
 
 void perl_command_bind_to(const char *cmd, const char *category,
@@ -371,11 +327,8 @@ void perl_command_bind_to(const char *cmd, const char *category,
 {
        char *signal;
 
-       command_bind_to(MODULE_NAME, priority, cmd, -1,
-                       category, priority_get_func(priority));
-
        signal = g_strconcat("command ", cmd, NULL);
-       perl_signal_add_to_int(signal, func, priority, TRUE);
+       perl_signal_add_full_int(signal, func, priority, TRUE, category);
        g_free(signal);
 }
 
@@ -405,10 +358,6 @@ static int signal_destroy_hash(void *key, GSList **list, PERL_SCRIPT_REC *script
                next = tmp->next;
                if (script == NULL || rec->script == script) {
                        *list = g_slist_remove(*list, rec);
-                       if (*list == NULL) {
-                               signal_remove_id(rec->signal_id,
-                                                perl_signal_get_func(rec));
-                       }
                        perl_signal_destroy(rec);
                }
        }
@@ -423,35 +372,20 @@ static int signal_destroy_hash(void *key, GSList **list, PERL_SCRIPT_REC *script
 /* destroy all signals used by script */
 void perl_signal_remove_script(PERL_SCRIPT_REC *script)
 {
-       int n;
-
-       for (n = 0; n < sizeof(signals)/sizeof(signals[0]); n++) {
-               g_hash_table_foreach_remove(signals[n],
-                                           (GHRFunc) signal_destroy_hash,
-                                           script);
-       }
+       g_hash_table_foreach_remove(signals, (GHRFunc) signal_destroy_hash,
+                                   script);
 }
 
 void perl_signals_start(void)
 {
-       int n;
-
-       for (n = 0; n < sizeof(signals)/sizeof(signals[0]); n++) {
-               signals[n] = g_hash_table_new((GHashFunc) g_direct_hash,
-                                             (GCompareFunc) g_direct_equal);
-       }
+       signals = g_hash_table_new(NULL, NULL);
 }
 
 void perl_signals_stop(void)
 {
-       int n;
-
-       for (n = 0; n < sizeof(signals)/sizeof(signals[0]); n++) {
-               g_hash_table_foreach(signals[n],
-                                    (GHFunc) signal_destroy_hash, NULL);
-               g_hash_table_destroy(signals[n]);
-                signals[n] = NULL;
-       }
+       g_hash_table_foreach(signals, (GHFunc) signal_destroy_hash, NULL);
+       g_hash_table_destroy(signals);
+       signals = NULL;
 }
 
 void perl_signals_init(void)
index 33e0c1b8a4d3e5e43720766ac1a5ed137e199dfd..92196d0484fe7f99ad2486ccdf9feb3eef5eccd7 100644 (file)
@@ -1,13 +1,7 @@
 #ifndef __PERL_SIGNALS_H
 #define __PERL_SIGNALS_H
 
-void perl_signal_add_to(const char *signal, SV *func, int priority);
-#define perl_signal_add_first(signal, func) \
-        perl_signal_add_to(signal, func, 0)
-#define perl_signal_add(signal, func) \
-        perl_signal_add_to(signal, func, 1)
-#define perl_signal_add_last(signal, func) \
-        perl_signal_add_to(signal, func, 2)
+void perl_signal_add_full(const char *signal, SV *func, int priority);
 
 void perl_signal_remove(const char *signal, SV *func);
 /* remove all signals used by script */
index 0ad8c86a4ab8ba3a7dd30f75af96c7986269179a..f9cc02001decba8972481b2f4d170c2a8a3ffa9b 100644 (file)
@@ -11,16 +11,21 @@ format_get_text(window, module, server, target, formatnum, ...)
        char *target
        int formatnum
 PREINIT:
+       TEXT_DEST_REC dest;
+       THEME_REC *theme;
        char **charargs;
        char *ret;
        int n;
 PPCODE:
        charargs = g_new0(char *, items-5+1);
-       charargs[items-5] = NULL;
         for (n = 5; n < items; n++) {
                charargs[n-5] = (char *)SvPV(ST(n), PL_na);
        }
-       ret = format_get_text(module, window, server, target, formatnum, charargs);
+
+       format_create_dest(&dest, server, target, 0, window);
+       theme = window_get_theme(dest.window);
+
+       ret = format_get_text_theme_charargs(theme, module, &dest, formatnum, charargs);
        g_free(charargs);
 
        XPUSHs(sv_2mortal(new_pv(ret)));
index fc3165e9872d5380b5b224286ad2995d91b31853..f452808368711ea3c7337b58e4dfd346f0acfb87 100644 (file)
@@ -223,3 +223,34 @@ PPCODE:
        }
        XPUSHs(sv_2mortal(new_pv(ret)));
        g_free_not_null(ret);
+
+char *
+theme_get_format(theme, module, tag)
+       Irssi::UI::Theme theme
+       char *module
+       char *tag
+PREINIT:
+       MODULE_THEME_REC *modtheme;
+       FORMAT_REC *formats;
+       char *ret;
+       int i;
+CODE:
+       formats = g_hash_table_lookup(default_formats, module);
+       if (formats == NULL)
+               croak("Unknown module: %s", module);
+
+       for (i = 0; formats[i].def != NULL; i++) {
+               if (formats[i].tag != NULL &&
+                   g_strcasecmp(formats[i].tag, tag) == 0)
+                       break;
+       }
+
+       if (formats[i].def == NULL)
+               croak("Unknown format tag: %s", tag);
+
+       modtheme = g_hash_table_lookup(theme->modules, module);
+       RETVAL = modtheme == NULL ? NULL : modtheme->formats[i];
+       if (RETVAL == NULL)
+               RETVAL = formats[i].def;
+OUTPUT:
+       RETVAL
index 6235e6f012912f0cd12f669eb195342a758305ba..108f6dbec1e3ec2625f535e7b70227e5b54e418a 100644 (file)
@@ -66,6 +66,8 @@ static void sig_channel_destroyed(SILC_CHANNEL_REC *channel)
 {
   if (!IS_SILC_CHANNEL(channel))
     return;
+  if (channel->server && channel->server->disconnected)
+    return;
 
   if (channel->server != NULL && !channel->left && !channel->kicked) {
     /* destroying channel record without actually
index 114f03af65d3a9e3e65e958c586f1901e3a0ffb1..9578ce9b5518253764e9dfd242bfac94de055ea9 100644 (file)
@@ -429,6 +429,8 @@ void silc_core_deinit(void)
   if (idletag != -1) {
     signal_emit("chat protocol deinit", 1,
                chat_protocol_find("SILC"));
+    signal_remove("irssi init read settings", 
+                 (SIGNAL_FUNC) sig_init_read_settings);
     
     silc_server_deinit();
     silc_channels_deinit();
index 8aac88cdcaef7feaf653dce5eab9caeba8e4861c..e7a3e3e31bbd703e8a28c25233c583c2197c455e 100644 (file)
@@ -29,6 +29,7 @@ all:
        touch draft-riikonen-silc-ke-auth-05.txt
        touch draft-riikonen-silc-commands-03.txt
        touch draft-riikonen-silc-flags-payloads-00.txt
+       touch draft-riikonen-presence-attrs-00.txt
 
 if SILC_DIST_CLIENT
 dist-hook:
@@ -38,6 +39,7 @@ dist-hook:
        touch draft-riikonen-silc-ke-auth-05.txt
        touch draft-riikonen-silc-commands-03.txt
        touch draft-riikonen-silc-flags-payloads-00.txt
+       touch draft-riikonen-presence-attrs-00.txt
 else
 if SILC_DIST_TOOLKIT
 dist-hook:
@@ -54,6 +56,7 @@ dist-hook:
        touch draft-riikonen-silc-ke-auth-05.txt
        touch draft-riikonen-silc-commands-03.txt
        touch draft-riikonen-silc-flags-payloads-00.txt
+       touch draft-riikonen-presence-attrs-00.txt
        $(makerfc) draft-riikonen-silc-spec-05.nroff \
                draft-riikonen-silc-spec-05.txt
        $(makerfc) draft-riikonen-silc-pp-05.nroff \
@@ -64,6 +67,8 @@ dist-hook:
                draft-riikonen-silc-commands-03.txt
        $(makerfc) draft-riikonen-silc-flags-payloads-00.nroff \
                draft-riikonen-silc-flags-payloads-00.txt
+       $(makerfc) draft-riikonen-presence-attrs-00.nroff \
+               draft-riikonen-presence-attrs-00.txt
 else
 dist-hook:
        touch draft-riikonen-silc-spec-05.txt
@@ -71,6 +76,7 @@ dist-hook:
        touch draft-riikonen-silc-ke-auth-05.txt
        touch draft-riikonen-silc-commands-03.txt
        touch draft-riikonen-silc-flags-payloads-00.txt
+       touch draft-riikonen-presence-attrs-00.txt
        $(makerfc) draft-riikonen-silc-spec-05.nroff \
                draft-riikonen-silc-spec-05.txt
        $(makerfc) draft-riikonen-silc-pp-05.nroff \
@@ -79,8 +85,8 @@ dist-hook:
                draft-riikonen-silc-ke-auth-05.txt
        $(makerfc) draft-riikonen-silc-commands-03.nroff \
                draft-riikonen-silc-commands-03.txt
-       $(makerfc) draft-riikonen-silc-flags-payloads-00.nroff \
-               draft-riikonen-silc-flags-payloads-00.txt
+       $(makerfc) draft-riikonen-presence-attrs-00.nroff \
+               draft-riikonen-presence-attrs-00.txt
 endif
 endif
 
index 1db9bc3d66de1ca1dbd0fce313790cde11029a70..89ec6b11cdf3bc848e8273eed5cef887f07a3e01 100644 (file)
@@ -2300,13 +2300,13 @@ security of this protocol.
 4 References
 
 [SILC1]      Riikonen, P., "Secure Internet Live Conferencing (SILC),
-             Protocol Specification", Internet Draft, April 2001.
+             Protocol Specification", Internet Draft, May 2002.
 
 [SILC2]      Riikonen, P., "SILC Packet Protocol", Internet Draft,
-             April 2001.
+             May 2002.
 
 [SILC3]      Riikonen, P., "SILC Key Exchange and Authentication 
-             Protocols", Internet Draft, April 2001.
+             Protocols", Internet Draft, May 2002.
 
 [IRC]        Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
              RFC 1459, May 1993.
@@ -2364,8 +2364,8 @@ security of this protocol.
 [RFC2279]    Yergeau, F., "UTF-8, a transformation format of ISO
              10646", RFC 2279, January 1998.
 
-
-
+[ATTRS]      Riikonen, P., "User Online Presence and Information
+             Attributes", Internet Draft, May 2002.
 
 
 .ti 0
index 38d1cd23818f72f20f2ee9300f0e9b9f3078db6c..a827ccfc80ecc2f197eaef4df51cba38871ebe57 100644 (file)
@@ -261,10 +261,10 @@ support S/MIME may be desired in some implementations.
 5 References 
 
 [SILC1]      Riikonen, P., "Secure Internet Live Conferencing (SILC),
-             Protocol Specification", Internet Draft, April 2001.
+             Protocol Specification", Internet Draft, May 2002.
 
 [SILC2]      Riikonen, P., "SILC Packet Protocol", Internet Draft,
-             April 2001.
+             May 2002.
 
 [RFC2045]    Freed, N., et al., "Multipurpose Internet Mail Extensions 
              (MIME) Part One: Format of Internet Message Bodies",
index 7089aa4810c884495c065760dcd94bfa976d4b8e..247e99d5c463feb56c6815aa38d165ff6a6d3642 100644 (file)
@@ -1052,12 +1052,12 @@ security of this protocol.
 5 References
 
 [SILC1]      Riikonen, P., "Secure Internet Live Conferencing (SILC),
-             Protocol Specification", Internet Draft, April 2001.
+             Protocol Specification", Internet Draft, May 2002.
 
 [SILC2]      Riikonen, P., "SILC Packet Protocol", Internet Draft,
-             April 2001.
+             May 2002.
 
-[SILC4]      Riikonen, P., "SILC Commands", Internet Draft, April 2001.
+[SILC4]      Riikonen, P., "SILC Commands", Internet Draft, May 2002.
 
 [IRC]        Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
              RFC 1459, May 1993.
index 597b95869554283d9762b42533fded1faf16a602..f3445fd0a0f2baf3d6d96a8ae3858ba827517003 100644 (file)
@@ -2925,12 +2925,12 @@ security of this protocol.
 4 References
 
 [SILC1]      Riikonen, P., "Secure Internet Live Conferencing (SILC),
-             Protocol Specification", Internet Draft, April 2001.
+             Protocol Specification", Internet Draft, May 2002.
 
 [SILC3]      Riikonen, P., "SILC Key Exchange and Authentication 
-             Protocols", Internet Draft, April 2001.
+             Protocols", Internet Draft, May 2002.
 
-[SILC4]      Riikonen, P., "SILC Commands", Internet Draft, April 2001.
+[SILC4]      Riikonen, P., "SILC Commands", Internet Draft, May 2002.
 
 [IRC]        Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
              RFC 1459, May 1993.
index 0e8a5ee551337c52bcf93285aa222a3db4102bd1..417a73aed920db5161212bec5339eb45d070edbb 100644 (file)
@@ -2305,12 +2305,12 @@ should have a forum to discuss the cell management issues.
 6 References
 
 [SILC2]      Riikonen, P., "SILC Packet Protocol", Internet Draft,
-             April 2001.
+             May 2002.
 
 [SILC3]      Riikonen, P., "SILC Key Exchange and Authentication 
-             Protocols", Internet Draft, April 2001.
+             Protocols", Internet Draft, May 2002.
 
-[SILC4]      Riikonen, P., "SILC Commands", Internet Draft, April 2001.
+[SILC4]      Riikonen, P., "SILC Commands", Internet Draft, May 2002.
 
 [IRC]        Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
              RFC 1459, May 1993.
diff --git a/prepare b/prepare
index f5cfff57183be5e2f33aa19250a525bfc3f2940a..09da0308a492a07607782a1afee36caa6c627b31 100755 (executable)
--- a/prepare
+++ b/prepare
@@ -37,7 +37,7 @@
 # SILC Distribution versions. Set here or give the version on the command
 # line as argument.
 #
-SILC_VERSION=0.8.2                     # Base version
+SILC_VERSION=0.9                       # Base version
 
 #############################################################################