From 194a013379b8f86de6abacf04266523a85d27be9 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 16 Mar 2002 12:41:58 +0000 Subject: [PATCH] Merged with Irssi 0.8.4 from irssi.org CVS. --- CHANGES | 2 + apps/irssi/configure.in | 2 +- apps/irssi/docs/startup-HOWTO.html | 13 +++-- apps/irssi/src/core/modules-load.c | 15 +++--- apps/irssi/src/core/nicklist.c | 3 ++ apps/irssi/src/core/servers.c | 5 +- apps/irssi/src/fe-common/core/fe-channels.c | 10 ++-- apps/irssi/src/fe-common/core/fe-queries.c | 8 +++- apps/irssi/src/fe-common/core/fe-windows.c | 3 +- .../irssi/src/fe-common/core/module-formats.c | 2 +- apps/irssi/src/fe-common/core/printtext.c | 8 +++- apps/irssi/src/fe-text/statusbar.h | 4 +- apps/irssi/src/fe-text/term-terminfo.c | 8 +++- apps/irssi/src/fe-text/term.c | 48 +++++++++++-------- apps/irssi/src/fe-text/term.h | 3 ++ apps/irssi/src/fe-text/terminfo-core.c | 1 - apps/irssi/src/perl/Makefile.am | 6 ++- apps/irssi/src/perl/ui/Window.xs | 3 +- 18 files changed, 94 insertions(+), 50 deletions(-) diff --git a/CHANGES b/CHANGES index aed8262b..d2b8fed1 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ Sat Mar 16 09:07:27 EET 2002 Pekka Riikonen * 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 * Check for valid socket connection in client entries before diff --git a/apps/irssi/configure.in b/apps/irssi/configure.in index 55dda382..2031de73 100644 --- a/apps/irssi/configure.in +++ b/apps/irssi/configure.in @@ -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 diff --git a/apps/irssi/docs/startup-HOWTO.html b/apps/irssi/docs/startup-HOWTO.html index af92b83e..cb323cda 100644 --- a/apps/irssi/docs/startup-HOWTO.html +++ b/apps/irssi/docs/startup-HOWTO.html @@ -44,7 +44,10 @@
  • How do I make F1 key do something?
-
  • Proxies and IRC bouncers
  • +
  • Proxies and IRC bouncers +
      +
    • What's this irssi-proxy?
    • +
  • Irssi's settings
  • Statusbar
      @@ -683,10 +686,10 @@ user's password with /SERVER ADD.

      --with-proxy option to configure. You'll still need to run irssi in a screen to use it though.

      -

      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).

      +

      Irssi proxy is a bit different than most proxies, normally proxies +create a new connection to IRC server when you connect to it, but +irssi proxy shares your existing IRC connection(s) to multiple +clients.

      Irssi proxy supports sharing multiple server connections in different ports, like you can share ircnet in port 2777 and efnet in port 2778.

      diff --git a/apps/irssi/src/core/modules-load.c b/apps/irssi/src/core/modules-load.c index e7e78091..69bdecdf 100644 --- a/apps/irssi/src/core/modules-load.c +++ b/apps/irssi/src/core/modules-load.c @@ -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 */ diff --git a/apps/irssi/src/core/nicklist.c b/apps/irssi/src/core/nicklist.c index b7e85407..7b97cb8e 100644 --- a/apps/irssi/src/core/nicklist.c +++ b/apps/irssi/src/core/nicklist.c @@ -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); diff --git a/apps/irssi/src/core/servers.c b/apps/irssi/src/core/servers.c index 2f3d15d1..a5a8c701 100644 --- a/apps/irssi/src/core/servers.c +++ b/apps/irssi/src/core/servers.c @@ -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; } diff --git a/apps/irssi/src/fe-common/core/fe-channels.c b/apps/irssi/src/fe-common/core/fe-channels.c index 01b8aced..ec5d395b 100644 --- a/apps/irssi/src/fe-common/core/fe-channels.c +++ b/apps/irssi/src/fe-common/core/fe-channels.c @@ -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); diff --git a/apps/irssi/src/fe-common/core/fe-queries.c b/apps/irssi/src/fe-common/core/fe-queries.c index 40df4ec9..1ea056e9 100644 --- a/apps/irssi/src/fe-common/core/fe-queries.c +++ b/apps/irssi/src/fe-common/core/fe-queries.c @@ -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); diff --git a/apps/irssi/src/fe-common/core/fe-windows.c b/apps/irssi/src/fe-common/core/fe-windows.c index fe76427b..38dd22fe 100644 --- a/apps/irssi/src/fe-common/core/fe-windows.c +++ b/apps/irssi/src/fe-common/core/fe-windows.c @@ -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) { diff --git a/apps/irssi/src/fe-common/core/module-formats.c b/apps/irssi/src/fe-common/core/module-formats.c index b3b4c8d6..690ae737 100644 --- a/apps/irssi/src/fe-common/core/module-formats.c +++ b/apps/irssi/src/fe-common/core/module-formats.c @@ -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 }, diff --git a/apps/irssi/src/fe-common/core/printtext.c b/apps/irssi/src/fe-common/core/printtext.c index 36984219..dbd52343 100644 --- a/apps/irssi/src/fe-common/core/printtext.c +++ b/apps/irssi/src/fe-common/core/printtext.c @@ -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) diff --git a/apps/irssi/src/fe-text/statusbar.h b/apps/irssi/src/fe-text/statusbar.h index 2e411fd2..148fd02e 100644 --- a/apps/irssi/src/fe-text/statusbar.h +++ b/apps/irssi/src/fe-text/statusbar.h @@ -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; diff --git a/apps/irssi/src/fe-text/term-terminfo.c b/apps/irssi/src/fe-text/term-terminfo.c index 4e9781fe..5716b36c 100644 --- a/apps/irssi/src/fe-text/term-terminfo.c +++ b/apps/irssi/src/fe-text/term-terminfo.c @@ -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; diff --git a/apps/irssi/src/fe-text/term.c b/apps/irssi/src/fe-text/term.c index a50fc8a3..94d81cfd 100644 --- a/apps/irssi/src/fe-text/term.c +++ b/apps/irssi/src/fe-text/term.c @@ -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 diff --git a/apps/irssi/src/fe-text/term.h b/apps/irssi/src/fe-text/term.h index 3607fad5..b5103c14 100644 --- a/apps/irssi/src/fe-text/term.h +++ b/apps/irssi/src/fe-text/term.h @@ -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); diff --git a/apps/irssi/src/fe-text/terminfo-core.c b/apps/irssi/src/fe-text/terminfo-core.c index 21a7b0a6..524fb9d0 100644 --- a/apps/irssi/src/fe-text/terminfo-core.c +++ b/apps/irssi/src/fe-text/terminfo-core.c @@ -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 */ diff --git a/apps/irssi/src/perl/Makefile.am b/apps/irssi/src/perl/Makefile.am index 7e0be023..2725d72d 100644 --- a/apps/irssi/src/perl/Makefile.am +++ b/apps/irssi/src/perl/Makefile.am @@ -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 \ diff --git a/apps/irssi/src/perl/ui/Window.xs b/apps/irssi/src/perl/ui/Window.xs index ac65480e..cadff1ab 100644 --- a/apps/irssi/src/perl/ui/Window.xs +++ b/apps/irssi/src/perl/ui/Window.xs @@ -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) -- 2.43.0