From 42f749346b375ccd5e46527a21ff2e7192273f5f Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Wed, 8 Sep 2021 13:03:03 +0200 Subject: [PATCH 01/22] Merge pull request #34 from ailin-nemui/no-maxline remove oragono.io/maxline-2 (cherry picked from commit 7e1401140412361b813accd99aa367658435c12f) --- NEWS | 4 +--- src/irc/core/irc-servers.c | 21 --------------------- src/irc/core/irc-servers.h | 1 - 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/NEWS b/NEWS index b3282761..8be7531e 100644 --- a/NEWS +++ b/NEWS @@ -134,9 +134,7 @@ v1.3.0-an 2021-09-05 Ailin Nemui /SET show_account_notify to enable + Add support for IRCv3 invite-notify (#1094) + Add support for receiving IRCv3 message-tags (#576, #1090) - + Add support for sending IRCv3 message-tags (#1092) - + Add support for the oragono.io/maxline-2 CAP to increase IRC - protocol line length (#1092) + + Add support for sending IRCv3 message-tags (#1092, an#34) + Enable the znc.in/self-message CAP by default (#1123) + Add support for IRCv3 away-notify. /SET away_notify_public to enable (#1099, GL#33, #1105) diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index 1c9f0cec..664ca9a4 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -282,7 +282,6 @@ static void server_init_1(IRC_SERVER_REC *server) irc_cap_toggle(server, CAP_SASL, TRUE); } - irc_cap_toggle(server, CAP_MAXLINE, TRUE); irc_cap_toggle(server, CAP_MULTI_PREFIX, TRUE); irc_cap_toggle(server, CAP_EXTENDED_JOIN, TRUE); irc_cap_toggle(server, CAP_SETNAME, TRUE); @@ -647,24 +646,6 @@ static void sig_server_quit(IRC_SERVER_REC *server, const char *msg) g_free(recoded); } -static void cap_maxline(IRC_SERVER_REC *server) -{ - unsigned int maxline = 0; - gboolean parse_successful = FALSE; - const char *maxline_str; - - maxline_str = g_hash_table_lookup(server->cap_supported, CAP_MAXLINE); - if (maxline_str != NULL) { - parse_successful = parse_uint(maxline_str, NULL, 10, &maxline); - - } - - if (parse_successful && - maxline >= MAX_IRC_MESSAGE_LEN + 2 /* 2 bytes for CR+LF */) { - server->max_message_len = maxline - 2; - } -} - void irc_server_send_action(IRC_SERVER_REC *server, const char *target, const char *data) { char *recoded; @@ -1226,7 +1207,6 @@ void irc_servers_init(void) signal_add_first("server disconnected", (SIGNAL_FUNC) sig_disconnected); signal_add_last("server destroyed", (SIGNAL_FUNC) sig_destroyed); signal_add_last("server quit", (SIGNAL_FUNC) sig_server_quit); - signal_add("server cap ack " CAP_MAXLINE, (SIGNAL_FUNC) cap_maxline); signal_add("event 670", (SIGNAL_FUNC) event_starttls); signal_add("event 451", (SIGNAL_FUNC) event_registerfirst); signal_add("server cap end", (SIGNAL_FUNC) event_capend); @@ -1258,7 +1238,6 @@ void irc_servers_deinit(void) signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected); signal_remove("server destroyed", (SIGNAL_FUNC) sig_destroyed); signal_remove("server quit", (SIGNAL_FUNC) sig_server_quit); - signal_remove("server cap ack " CAP_MAXLINE, (SIGNAL_FUNC) cap_maxline); signal_remove("event 670", (SIGNAL_FUNC) event_starttls); signal_remove("event 451", (SIGNAL_FUNC) event_registerfirst); signal_remove("server cap end", (SIGNAL_FUNC) event_capend); diff --git a/src/irc/core/irc-servers.h b/src/irc/core/irc-servers.h index 93fa02a4..903de773 100644 --- a/src/irc/core/irc-servers.h +++ b/src/irc/core/irc-servers.h @@ -15,7 +15,6 @@ #define MAX_IRC_USER_TAGS_LEN 4094 #define CAP_LS_VERSION "302" -#define CAP_MAXLINE "oragono.io/maxline-2" #define CAP_MESSAGE_TAGS "message-tags" #define CAP_SASL "sasl" #define CAP_MULTI_PREFIX "multi-prefix" From 0f3e95892de7e7a360336fcc9739e770916a9156 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Wed, 8 Sep 2021 13:03:14 +0200 Subject: [PATCH 02/22] Merge pull request #35 from ailin-nemui/fixes duplicate issue in NEWS (cherry picked from commit d3e105a3963cbc693ac316ae884b000902999828) --- NEWS | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 8be7531e..ced7bcd5 100644 --- a/NEWS +++ b/NEWS @@ -127,8 +127,7 @@ v1.3.0-an 2021-09-05 Ailin Nemui join_extended_account, that theme writers need to take into account if desired. - + Add support for IRCv3 setname (#1093, #1104, #1254, GL#33, - #1104, #1254) + + Add support for IRCv3 setname (#1093, #1104, #1254, GL#33) + Add support for IRCv3 account-notify (#1100, #1098, GL#33, #1105, #1131). Credit to oss-fuzz /SET show_account_notify to enable From 8b49cd012dc4af4040eb4ef03939e80072d40a5f Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Wed, 15 Sep 2021 17:56:45 +0200 Subject: [PATCH 03/22] Merge pull request #36 from ailin-nemui/missing-hilights correctly store updated message levels e.g. from /hilight (cherry picked from commit ad8221835c90969a6ba87807b072ba9f4d63bd48) --- NEWS | 5 +++-- src/fe-text/textbuffer-formats.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index ced7bcd5..b7c62b93 100644 --- a/NEWS +++ b/NEWS @@ -2,9 +2,10 @@ v1.3.0-an 2021-09-05 Ailin Nemui * /SET resolve_reverse_lookup setting was removed (#1135) * Irssi will try to connect on IPv4 if IPv6 connection failed (#1146). By Shivaram Lingamneni + * The display system now renders formats on the fly (#1079, - #1188, #1191, #1192, #1204, #1205, #1209, an#13, an#14, an#28, - an#29) + #1188, #1191, #1192, #1204, #1205, #1209, #1349, an#13, + an#14, an#28, an#29, an#36) This major change will break scripts that try to modify printed text during "print text" signal (#1189). They need diff --git a/src/fe-text/textbuffer-formats.c b/src/fe-text/textbuffer-formats.c index 20abc0df..50d6250a 100644 --- a/src/fe-text/textbuffer-formats.c +++ b/src/fe-text/textbuffer-formats.c @@ -265,7 +265,7 @@ static void sig_gui_print_text_finished(WINDOW_REC *window, TEXT_DEST_REC *dest) info->meta = line_meta_create(dest->meta); - info->level |= MSGLEVEL_FORMAT; + info->level = dest->level | MSGLEVEL_FORMAT; /* the line will be inserted into the view with textbuffer_view_insert_line by gui-printtext.c:view_add_eol */ From 0932bbed7b1f51a00cfee231632e67ab9118da75 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 21 Sep 2021 22:35:30 +0200 Subject: [PATCH 04/22] Merge pull request #37 from ailin-nemui/int-min-reached fix pedantic error in MSGLEVEL enum (cherry picked from commit b0fdbb144d5c5723269b2571761b0a073a392454) --- src/core/levels.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/levels.h b/src/core/levels.h index 04893b34..7f1aa931 100644 --- a/src/core/levels.h +++ b/src/core/levels.h @@ -42,7 +42,7 @@ enum { MSGLEVEL_HIDDEN = 0x10000000, /* Hidden from view */ MSGLEVEL_RESERVED1 = 0x20000000, MSGLEVEL_RESERVED2 = 0x40000000, - MSGLEVEL_FORMAT = 0x80000000 /* Format data */ + MSGLEVEL_FORMAT = (int)0x80000000 /* Format data */ }; /* clang-format on */ From 117758fb9046a859ecfacaab7ab1a7a2e35377e6 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Wed, 22 Sep 2021 11:25:32 +0200 Subject: [PATCH 05/22] Merge pull request #40 from ailin-nemui/gh-actions update github actions ubuntu version to 18.04 and meson to <0.60.0 (cherry picked from commit db705278d2f766433d3c28f776241c4997efde70) --- .github/workflows/check.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 61de72ff..97cb3feb 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -18,7 +18,7 @@ jobs: steps: - name: prepare required software run: | - sudo apt install $apt_build_deps $apt_build_deps_autotools + sudo apt update && sudo apt install $apt_build_deps $apt_build_deps_autotools - uses: actions/checkout@main - name: make dist run: | @@ -38,18 +38,18 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-16.04, ubuntu-latest] + os: [ubuntu-18.04, ubuntu-latest] builder: [meson, configure] compiler: [clang, gcc] flags: [regular] include: - - os: ubuntu-16.04 + - os: ubuntu-18.04 builder: meson meson_ver: ==0.49.2 setuptools_ver: <51 - os: ubuntu-latest builder: meson - meson_ver: <0.59.0 + meson_ver: <0.60.0 - os: ubuntu-latest builder: meson flags: meson-latest FAILURE-OK @@ -64,7 +64,7 @@ jobs: meson_ver: ${{ matrix.meson_ver }} setuptools_ver: ${{ matrix.setuptools_ver }} run: | - sudo apt install $apt_build_deps $apt_build_deps_${{ matrix.builder }} + sudo apt update && sudo apt install $apt_build_deps $apt_build_deps_${{ matrix.builder }} eval "$get_pip_build_deps_${{ matrix.builder }}" curl -SLf https://github.com/irssi-import/actions-irssi/raw/master/check-irssi/render.pl -o ~/render.pl && chmod +x ~/render.pl - name: unpack archive From 0ba449d8be26b047eea3b0b7e4ecdcba906f03f8 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Wed, 22 Sep 2021 12:33:10 +0200 Subject: [PATCH 06/22] Merge pull request #39 from ailin-nemui/sync run syncdocs.sh and syncscripts.sh (cherry picked from commit 85a9dc146d803be344bf3806395ac294d6929c13) --- docs/faq.html | 4 +- docs/faq.txt | 6 +- docs/startup-HOWTO.html | 4 +- docs/startup-HOWTO.txt | 4 +- scripts/quitmsg.pl | 27 +++----- scripts/scriptassist.pl | 139 +++++++++++++++++++++++++--------------- 6 files changed, 104 insertions(+), 80 deletions(-) diff --git a/docs/faq.html b/docs/faq.html index 7c17f45d..50b404a0 100644 --- a/docs/faq.html +++ b/docs/faq.html @@ -2,7 +2,7 @@

Frequently Asked Questions

Q: Why doesn’t irssi display colors even when ircii etc. displays them?

-

A: They force ANSI colors even if terminal doesn’t support them. By default, irssi uses colors only if terminfo/termcap so says. The correct way to fix this would be to change your TERM environment to a value where colors work, like xterm-color or color_xterm (eg. TERM=xterm-color irssi). If this doesn’t help, then use the evil way of /SET term_force_colors ON.

+

A: They force ANSI colors even if terminal doesn’t support them. By default, irssi uses colors only if terminfo/termcap so says. The correct way to fix this would be to change your TERM environment to a value where colors work, like xterm-256color or color_xterm (eg. TERM=xterm-256color irssi). If this doesn’t help, then use the evil way of /SET term_force_colors ON.

Q: How do I easily write text to channel that starts with ‘/’ character?

@@ -54,7 +54,7 @@

Q: Will there be /DETACH-like feature?

-

A: tmux, screen and dtach can be used to do it just fine.

+

A: tmux, screen and dtach can be used to do it just fine.

Q: How do I run scripts automatically at startup?

diff --git a/docs/faq.txt b/docs/faq.txt index 0d0b5f46..0fcc156a 100644 --- a/docs/faq.txt +++ b/docs/faq.txt @@ -4,8 +4,8 @@ Q: Why doesn’t irssi display colors even when ircii etc. displays them? A: They force ANSI colors even if terminal doesn’t support them. By default, irssi uses colors only if terminfo/termcap so says. The correct way to fix this would be to change your TERM environment to a value where colors work, like - xterm-color or color_xterm (eg. TERM=xterm-color irssi). If this doesn’t help, - then use the evil way of /SET term_force_colors ON. + xterm-256color or color_xterm (eg. TERM=xterm-256color irssi). If this doesn’t + help, then use the evil way of /SET term_force_colors ON. Q: How do I easily write text to channel that starts with ‘/’ character? A: / /text @@ -119,6 +119,6 @@ A: Check [6]here [1] https://github.com/irssi-import/xirssi [2] https://tmux.github.io/ [3] https://www.gnu.org/software/screen/screen.html - [4] http://dtach.sf.net/ + [4] https://sourceforge.net/projects/dtach/ [5] https://dgl.cx/irssi/hack-whois-in-current-window.pl [6] https://irssi.org/assets/irssi.wav diff --git a/docs/startup-HOWTO.html b/docs/startup-HOWTO.html index b0c68f1f..696dea4d 100644 --- a/docs/startup-HOWTO.html +++ b/docs/startup-HOWTO.html @@ -226,7 +226,7 @@ Ctrl-P, Ctrl-N - Jump to previous / next window

And finally channels:

-
/CHANNEL ADD -auto -bots *!*user@host -botcmd "/^msg $0 op pass" #irssi efnet
+
/CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass" #irssi efnet
 /CHANNEL ADD -auto #secret IRCnet password
 
@@ -395,7 +395,7 @@ Ctrl-X - set the next server in list active

/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:

-
 [user@host] ~% cat
+
 [cras@hurina] ~% cat
  ^[OP
 
diff --git a/docs/startup-HOWTO.txt b/docs/startup-HOWTO.txt index bff33108..90d278de 100644 --- a/docs/startup-HOWTO.txt +++ b/docs/startup-HOWTO.txt @@ -218,7 +218,7 @@ IRC network, other servers are automatically connected in same network if the And finally channels: -/CHANNEL ADD -auto -bots *!*user@host -botcmd "/^msg $0 op pass" #irssi efnet +/CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass" #irssi efnet /CHANNEL ADD -auto #secret IRCnet password -bots and -botcmd should be the only ones needing a bit of explaining. They’re @@ -442,7 +442,7 @@ 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: - [user@host] ~% cat + [cras@hurina] ~% cat ^[OP So in irssi you would use /BIND ^[OP /ECHO F1 pressed. If you use multiple diff --git a/scripts/quitmsg.pl b/scripts/quitmsg.pl index e289468c..102d9aa5 100644 --- a/scripts/quitmsg.pl +++ b/scripts/quitmsg.pl @@ -6,36 +6,27 @@ use Irssi::Irc; use strict; use vars qw($VERSION %IRSSI); -$VERSION = "1.00"; +$VERSION = "1.01"; %IRSSI = ( authors => 'Timo Sirainen', name => 'quitmsg', description => 'Random quit messages', license => 'Public Domain', - changed => 'Sun Mar 10 23:18 EET 2002' + changed => 'Mon Jul 22 20:00 EET 2020' ); -my $quitfile = glob "~/.irssi/irssi.quit"; +my $quitfile = Irssi::get_irssi_dir() . "/irssi.quit"; sub cmd_quit { my ($data, $server, $channel) = @_; return if ($data ne ""); + + open (my $fh, "<", $quitfile) || return; + my @lines = <$fh>; - open (f, "<", $quitfile) || return; - my $lines = 0; while() { $lines++; }; - - my $line = int(rand($lines))+1; - - my $quitmsg; - seek(f, 0, 0); $. = 0; - while() { - next if ($. != $line); - - chomp; - $quitmsg = $_; - last; - } - close(f); + my $quitmsg = $lines[int(rand(@lines))]; + chomp($quitmsg); + close($fh); foreach my $server (Irssi::servers) { $server->command("/disconnect ".$server->{tag}." $quitmsg"); diff --git a/scripts/scriptassist.pl b/scripts/scriptassist.pl index 536ef33a..cf02d57e 100644 --- a/scripts/scriptassist.pl +++ b/scripts/scriptassist.pl @@ -5,7 +5,7 @@ use strict; -our $VERSION = '2003020807'; +our $VERSION = '2020042700'; our %IRSSI = ( authors => 'Stefan \'tommie\' Tomanek', contact => 'stefan@pico.ruhr.de', @@ -23,12 +23,15 @@ use Irssi 20020324; use CPAN::Meta::YAML; use LWP::UserAgent; use POSIX; +use version; # GnuPG is not always needed $have_gpg = 0; eval "use GnuPG qw(:algo :trust);"; $have_gpg = 1 if not ($@); +my $irssi_version = qv(Irssi::parse_special('v$J') =~ s/-.*//r); + sub show_help { my $help = "scriptassist $VERSION /scriptassist check @@ -39,15 +42,15 @@ sub show_help { Search the script database /scriptassist info Display information about -".#/scriptassist ratings -# Retrieve the average ratings of the the scripts -#/scriptassist top -# Retrieve the first top rated scripts -"/scriptassist new +/scriptassist ratings + Retrieve the average ratings of the the scripts +/scriptassist top + Retrieve the first top rated scripts +/scriptassist new Display the newest scripts -".#/scriptassist rate