Merged with Irssi 0.8.4 from irssi.org CVS.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 16 Mar 2002 12:41:58 +0000 (12:41 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 16 Mar 2002 12:41:58 +0000 (12:41 +0000)
18 files changed:
CHANGES
apps/irssi/configure.in
apps/irssi/docs/startup-HOWTO.html
apps/irssi/src/core/modules-load.c
apps/irssi/src/core/nicklist.c
apps/irssi/src/core/servers.c
apps/irssi/src/fe-common/core/fe-channels.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/module-formats.c
apps/irssi/src/fe-common/core/printtext.c
apps/irssi/src/fe-text/statusbar.h
apps/irssi/src/fe-text/term-terminfo.c
apps/irssi/src/fe-text/term.c
apps/irssi/src/fe-text/term.h
apps/irssi/src/fe-text/terminfo-core.c
apps/irssi/src/perl/Makefile.am
apps/irssi/src/perl/ui/Window.xs

diff --git a/CHANGES b/CHANGES
index aed8262b8b73ad87dcd644df84e9e2313774c9bd..d2b8fed1b9651128574d2b7fd055a59f52dee402 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,8 @@ Sat Mar 16 09:07:27 EET 2002  Pekka Riikonen <priikone@silcnet.org>
        * Handled CHANNEL_CHANGE notify (ignore it) in Irssi SILC
          client.  Affected file irssi/src/silc/core/client_ops.c.
 
+       * Merged with Irssi 0.8.4 from irssi.org CVS.
+
 Thu Mar 14 12:53:57 CET 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * Check for valid socket connection in client entries before
index 55dda382d661078d3e6c3400f73f41018602e6d3..2031de73ef57cb8480fe8d19dc84cc00592ec0e1 100644 (file)
@@ -7,7 +7,7 @@ if test -n "`grep '^#undef VERSION' config.h.in`"; then
 fi
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(Irssi-SILC, 0.8.2)
+AM_INIT_AUTOMAKE(Irssi-SILC, 0.8.4+)
 
 AM_MAINTAINER_MODE
 
index af92b83e4a30660951d0371a03acb8ef4ad99c82..cb323cda120f3650bf5d213e03a755bd6450fbfd 100644 (file)
     <ul>
     <li>How do I make F1 key do something?</li>
     </ul></li>
-<li><a href="#c10">Proxies and IRC bouncers</a></li>
+<li><a href="#c10">Proxies and IRC bouncers</a>
+    <ul>
+    <li>What's this irssi-proxy?</li>
+    </ul></li>
 <li><a href="#c11">Irssi's settings</a></li>
 <li><a href="#c12">Statusbar</a>
     <ul>
@@ -683,10 +686,10 @@ user's password with /SERVER ADD.</p>
 <strong>--with-proxy</strong> 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 with irssi proxy
-all the clients use the same IRC server connection (a bit like how screen -x
-works).</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>
 
 <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>
index e7e780915815e7d24ad20024a4e2010f32020b88..69bdecdf07c61780b4f93eeb3dc401c1b2812b20 100644 (file)
@@ -64,13 +64,16 @@ static char *module_get_root(const char *name, char **prefixes)
        int len;
 
        /* skip any of the prefixes.. */
-       while (*prefixes != NULL) {
-                len = strlen(*prefixes);
-               if (strncmp(name, *prefixes, len) == 0 && name[len] == '_') {
-                       name += len+1;
-                        break;
+       if (prefixes != NULL) {
+               while (*prefixes != NULL) {
+                       len = strlen(*prefixes);
+                       if (strncmp(name, *prefixes, len) == 0 &&
+                           name[len] == '_') {
+                               name += len+1;
+                               break;
+                       }
+                       prefixes++;
                }
-               prefixes++;
        }
 
        /* skip the _core part */
index b7e8540725c4b5c8902e710437e75f1ae9b95dd6..7b97cb8ef67ebdf25c45ab0cc9767a45b8390418 100644 (file)
@@ -102,6 +102,9 @@ static void nicklist_destroy(CHANNEL_REC *channel, NICK_REC *nick)
 {
        signal_emit("nicklist remove", 2, channel, nick);
 
+       if (channel->ownnick == nick)
+                channel->ownnick = NULL;
+
         /*MODULE_DATA_DEINIT(nick);*/
        g_free(nick->nick);
        g_free_not_null(nick->realname);
index 2f3d15d1d22cb20ee6cfe0b0197dee932ba4ddd9..a5a8c701703005397fb2d62c5ca2451d85169420 100644 (file)
@@ -198,8 +198,9 @@ static void server_connect_callback_readpipe(SERVER_REC *server)
        } else {
                /* pick the one that was found, or if both do it like
                   /SET resolve_prefer_ipv6 says. */
-               ip = iprec.ip6.family != 0 &&
-                       settings_get_bool("resolve_prefer_ipv6") ?
+               ip = iprec.ip4.family == 0 ||
+                       (iprec.ip6.family != 0 &&
+                        settings_get_bool("resolve_prefer_ipv6")) ?
                        &iprec.ip6 : &iprec.ip4;
        }
 
index 01b8aced0781f368e5691d0531d9f63b929a426b..ec5d395bb14332cbac8b8e136894f024c895b011 100644 (file)
@@ -586,11 +586,13 @@ static void cmd_cycle(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
        window_bind_add(window_item_window(chanrec),
                        chanrec->server->tag, chanrec->name);
 
-       /* FIXME: kludgy kludgy... and it relies on channel not
-          being destroyed immediately.. */
+       /* FIXME: kludgy kludgy... */
        signal_emit("command part", 3, data, server, item);
-        chanrec->left = TRUE;
-       channel_destroy(chanrec);
+
+       if (g_slist_find(channels, chanrec) != NULL) {
+               chanrec->left = TRUE;
+               channel_destroy(chanrec);
+       }
 
        server->channels_join(server, joindata, FALSE);
        g_free(joindata);
index 40df4ec99af671fcf0665ae566834878feafec7f..1ea056e92340856136d5ac4fac3c96c679432116 100644 (file)
@@ -119,8 +119,12 @@ static void signal_query_nick_changed(QUERY_REC *query, const char *oldnick)
 
        format_create_dest_tag(&dest, query->server, query->server_tag,
                               query->name, MSGLEVEL_CLIENTNOTICE, NULL);
-       printformat_dest(&dest,  TXT_NICK_CHANGED, oldnick,
-                        query->name, query->name);
+
+       /* 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);
+       }
 
        signal_emit("window item changed", 2,
                    window_item_window((WI_ITEM_REC *) query), query);
index fe76427b466e42d12ca455ba51be5e52b20ad294..38dd22fec2a174904f59febf8a20b7dafefc2eb1 100644 (file)
@@ -247,7 +247,8 @@ WINDOW_REC *window_find_level(void *server, int level)
        GSList *tmp;
 
         /* prefer active window if possible */
-       if (WINDOW_LEVEL_MATCH(active_win, server, level))
+       if (active_win != NULL &&
+           WINDOW_LEVEL_MATCH(active_win, server, level))
                 return active_win;
 
        for (tmp = windows; tmp != NULL; tmp = tmp->next) {
index b3b4c8d600f77452ae262c8aae5dd5df8c6ee9cb..690ae73726cbe1c78223e6f4cc11a2c0a9e24000 100644 (file)
@@ -215,7 +215,7 @@ FORMAT_REC fecommon_core_formats[] = {
        { "chan_not_found", "Not joined to such channel", 0 },
        { "chan_not_synced", "Channel not fully synchronized yet, try again after a while", 0 },
        { "illegal_proto", "Command isn't designed for the chat protocol of the active server", 0 },
-       { "not_good_idea", "Doing this is not a good idea. Add -YES if you really mean it", 0 },
+       { "not_good_idea", "Doing this is not a good idea. Add -YES option to command if you really mean it", 0 },
 
        /* ---- */
        { NULL, "Themes", 0 },
index 369842196f1199b749248fce168bb9e211069f46..dbd52343a500e1b369bd1c4622d682fb64515059 100644 (file)
@@ -415,9 +415,15 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text)
        char *str, *tmp;
 
        g_return_if_fail(dest != NULL);
-       g_return_if_fail(dest->window != NULL);
        g_return_if_fail(text != NULL);
 
+       if (dest->window == NULL) {
+                str = strip_codes(text);
+               printf("NO WINDOWS: %s\n", str);
+                g_free(str);
+                return;
+       }
+
        msg_beep_check(dest);
 
         if ((dest->level & MSGLEVEL_NEVER) == 0)
index 2e411fd2ebdacc9a1079f0475270f188299e60c3..148fd02e5a2e4100f92ea00a5fb01b5056190e6e 100644 (file)
@@ -50,7 +50,7 @@ typedef struct {
        char *color; /* background color */
        int real_ypos; /* real Y-position in screen at the moment */
 
-       int dirty:1;
+       unsigned int dirty:1;
         int dirty_xpos; /* -1 = only redraw some items, >= 0 = redraw all items after from xpos */
 } STATUSBAR_REC;
 
@@ -74,7 +74,7 @@ struct SBAR_ITEM_REC {
        int xpos, size;
 
         int current_size; /* item size currently in screen */
-       int dirty:1;
+       unsigned int dirty:1;
 };
 
 extern GSList *statusbar_groups;
index 4e9781fe744f405efd4c786d97a74029086d7a91..5716b36c0655fa3f8dc383ef506fe472e321a955 100644 (file)
@@ -77,7 +77,8 @@ static int redraw_timeout(void)
 
 int term_init(void)
 {
-        struct sigaction act;
+       struct sigaction act;
+        int width, height;
 
        last_fg = last_bg = -1;
        last_attrs = 0;
@@ -89,6 +90,11 @@ int term_init(void)
        if (current_term == NULL)
                return FALSE;
 
+       if (term_get_size(&width, &height)) {
+                current_term->width = width;
+                current_term->height = height;
+       }
+
         /* grab CONT signal */
        sigemptyset(&act.sa_mask);
        act.sa_flags = 0;
index a50fc8a31a46f08272d4e646984e0113964e01aa..94d81cfd61b214542373cc0a5015ee0cfc85cb2a 100644 (file)
@@ -47,12 +47,31 @@ int term_type;
 static int force_colors;
 static int resize_dirty;
 
-/* Resize the terminal if needed */
-void term_resize_dirty(void)
+int term_get_size(int *width, int *height)
 {
 #ifdef TIOCGWINSZ
        struct winsize ws;
+
+       /* Get new window size */
+       if (ioctl(0, TIOCGWINSZ, &ws) < 0)
+               return FALSE;
+
+       *width = ws.ws_col;
+        *height = ws.ws_row;
+
+       if (*width < MIN_SCREEN_WIDTH)
+               *width = MIN_SCREEN_WIDTH;
+       if (*height < 1)
+                *height = 1;
+       return TRUE;
+#else
+        return FALSE;
 #endif
+}
+
+/* Resize the terminal if needed */
+void term_resize_dirty(void)
+{
         int width, height;
 
        if (!resize_dirty)
@@ -60,27 +79,14 @@ void term_resize_dirty(void)
 
         resize_dirty = FALSE;
 
-#ifdef TIOCGWINSZ
-       /* Get new window size */
-       if (ioctl(0, TIOCGWINSZ, &ws) < 0)
-               return;
+       if (!term_get_size(&width, &height))
+               width = height = -1;
 
-       if (ws.ws_row == term_height && ws.ws_col == term_width) {
-               /* Same size, abort. */
-               return;
+       if (height != term_height || width != term_width) {
+               term_resize(width, height);
+               mainwindows_resize(term_width, term_height);
+               term_resize_final(width, height);
        }
-
-       if (ws.ws_col < MIN_SCREEN_WIDTH)
-               ws.ws_col = MIN_SCREEN_WIDTH;
-
-       width = ws.ws_col;
-        height = ws.ws_row;
-#else
-        width = height = -1;
-#endif
-        term_resize(width, height);
-       mainwindows_resize(term_width, term_height);
-        term_resize_final(width, height);
 }
 
 #ifdef SIGWINCH
index 3607fad551209a3a0bb8e9d6fc4ae0ed87f50880..b5103c14be925208f7a6f179ff856b218f5cee78 100644 (file)
@@ -30,6 +30,9 @@ extern int term_use_colors, term_type, term_detached;
 int term_init(void);
 void term_deinit(void);
 
+/* Gets the current terminal size, returns TRUE if ok. */
+int term_get_size(int *width, int *height);
+
 /* Resize terminal - if width or height is negative,
    the new size is unknown and should be figured out somehow */
 void term_resize(int width, int height);
index 21a7b0a60c777496501132607056a8c8e29d2ceb..524fb9d0156502a3da1effd07416386284562e64 100644 (file)
@@ -199,7 +199,6 @@ static void _scroll_region_1(TERM_REC *term, int y1, int y2, int count)
                term->move(term, 0, y1);
                for (i = count; i < 0; i++)
                        tput(tparm(term->TI_ri));
-               tput(tparm(term->TI_rin, -count, -count));
        }
 
         /* reset the scrolling region to full screen */
index 7e0be0231a7f06c4a77285d2e1d5a6d33034d22e..2725d72d0fbcbaf278e8520c8cd97ceeeef78193 100644 (file)
@@ -137,7 +137,11 @@ install-exec-local:
        done
 
 clean-generic:
-       for dir in $(perl_dirs); do rm -f $$dir/Makefile; done
+       for dir in $(perl_dirs); do \
+         cd $$dir; \
+         $(MAKE) clean; \
+         cd ..; \
+       done
 
 distclean-generic:
        for dir in $(perl_dirs); do \
index ac65480eaf6c7c1f4f27e3814093008441ab9d9e..cadff1abdf5bfc82e09a59fb72d844f4b2f11763 100644 (file)
@@ -158,7 +158,8 @@ CODE:
        old = active_win;
        active_win = window;
        perl_command(cmd, window->active_server, window->active);
-        active_win = old;
+        if (g_slist_find(windows, old) != NULL)
+               active_win = old;
 
 void
 window_item_add(window, item, automatic)