diff --git a/.clang-format b/.clang-format
new file mode 100644
index 00000000..a0cb79c0
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,38 @@
+# IndentPPDirectives: AfterHash
+# SpaceInParentheses: false
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignOperands: true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: Empty
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+BinPackArguments: true
+BinPackParameters: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Linux
+BreakBeforeTernaryOperators: false
+ColumnLimit: 100
+IndentCaseLabels: false
+IndentWidth: 8
+IndentWrappedFunctionNames: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+Language: Cpp
+Cpp11BracedListStyle: false
+MaxEmptyLinesToKeep: 1
+PointerAlignment: Right
+SortIncludes: false
+SpaceAfterCStyleCast: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesInCStyleCastParentheses: false
+SpacesInSquareBrackets: false
+TabWidth: 8
+UseTab: ForIndentation
diff --git a/.github/workflows/abicheck.yml b/.github/workflows/abicheck.yml
new file mode 100644
index 00000000..254c64f9
--- /dev/null
+++ b/.github/workflows/abicheck.yml
@@ -0,0 +1,127 @@
+on: [pull_request]
+name: abicheck
+env:
+ build_options: -Dbuildtype=debug -Denable-true-color=yes -Dwith-proxy=yes -Dc_args=-DPERL_EUPXS_ALWAYS_EXPORT
+ prefix: /usr/local
+ apt_build_deps: ninja-build libutf8proc-dev libperl-dev libotr5-dev libglib2.0-dev
+ get_pip_build_deps: pip3 install 'setuptools<66'; pip3 install wheel; pip3 install 'meson<0.59.0'
+ getabidef_def: getabidef() { awk '$1=="#define" && $2=="IRSSI_ABI_VERSION" { print $3 }' "$1"/include/irssi/src/common.h; }
+jobs:
+ build-base-ref:
+ runs-on: ubuntu-latest
+ outputs:
+ base_abi: ${{ steps.out.outputs.base_abi }}
+ steps:
+ - name: set PATH
+ run: |
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+ - name: prepare required software
+ run: |
+ sudo apt update; sudo apt install $apt_build_deps
+ eval "$get_pip_build_deps"
+ - name: checkout base ref
+ uses: actions/checkout@main
+ with:
+ path: base.src
+ ref: ${{ github.base_ref }}
+ - name: build base ref
+ run: |
+ meson Build.base base.src $build_options
+ ninja -C Build.base
+ DESTDIR=$PWD/base ninja -C Build.base install
+ - id: out
+ run: |
+ # print versions and abi versions
+ eval "$getabidef_def"
+ base_abi=$(getabidef base$prefix)
+ echo base abi : $base_abi
+ ./base$prefix/bin/irssi --version
+ echo base_abi=$base_abi >> $GITHUB_OUTPUT
+ - uses: actions/upload-artifact@v4
+ with:
+ name: base.inst
+ path: base
+ retention-days: 1
+ build-merge-ref:
+ runs-on: ubuntu-latest
+ outputs:
+ merge_abi: ${{ steps.out.outputs.merge_abi }}
+ steps:
+ - name: set PATH
+ run: |
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+ - name: prepare required software
+ run: |
+ sudo apt update; sudo apt install $apt_build_deps
+ eval "$get_pip_build_deps"
+ - name: checkout merge ref
+ uses: actions/checkout@main
+ with:
+ path: merge.src
+ - name: build merge ref
+ run: |
+ meson Build.merge merge.src $build_options
+ ninja -C Build.merge
+ DESTDIR=$PWD/merge ninja -C Build.merge install
+ - id: out
+ run: |
+ # print versions and abi versions
+ eval "$getabidef_def"
+ merge_abi=$(getabidef merge$prefix)
+ echo merge abi : $merge_abi
+ ./merge$prefix/bin/irssi --version
+ echo merge_abi=$merge_abi >> $GITHUB_OUTPUT
+ - uses: actions/upload-artifact@v4
+ with:
+ name: merge.inst
+ path: merge
+ retention-days: 1
+ check-abi-diff:
+ runs-on: ubuntu-latest
+ needs:
+ - build-merge-ref
+ - build-base-ref
+ env:
+ base_abi: ${{ needs.build-base-ref.outputs.base_abi }}
+ merge_abi: ${{ needs.build-merge-ref.outputs.merge_abi }}
+ steps:
+ - name: prepare required software
+ run: |
+ sudo apt update; sudo apt install abigail-tools
+ - name: fetch base build
+ uses: actions/download-artifact@v4
+ with:
+ name: base.inst
+ path: base
+ - name: fetch merge build
+ uses: actions/download-artifact@v4
+ with:
+ name: merge.inst
+ path: merge
+ - run: |
+ # abipkgdiff
+ abipkgdiff -l base merge >abipkgdiff.out && diff_ret=0 || diff_ret=$?
+ echo "diff_ret=$diff_ret" >> $GITHUB_ENV
+ cat abipkgdiff.out
+ - uses: actions/upload-artifact@v4
+ with:
+ path: abipkgdiff.out
+ - run: |
+ # Check if no changes are needed
+ if [ "$diff_ret" -ne 0 ]; then
+ if [ "$base_abi" -lt "$merge_abi" ]; then
+ echo "::warning ::abigail found changes and ABI changed from $base_abi to $merge_abi"
+ exit 0
+ else
+ echo "::error ::Looks like the ABI changed but the IRSSI_ABI_VERSION did not"
+ exit $diff_ret
+ fi
+ else
+ if [ "$base_abi" -ne "$merge_abi" ]; then
+ echo "::error ::abigail found no changes yet the IRSSI_ABI_VERSION changed. Is this correct?"
+ exit 1
+ else
+ : "No changes detected and IRSSI_ABI_VERSION untouched"
+ exit 0
+ fi
+ fi
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
new file mode 100644
index 00000000..186c2e83
--- /dev/null
+++ b/.github/workflows/check.yml
@@ -0,0 +1,180 @@
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+name: Check Irssi
+env:
+ apt_build_deps: ninja-build libutf8proc-dev libperl-dev libotr5-dev libglib2.0-dev
+ get_pip_build_deps_meson: pip3 install setuptools${setuptools_ver}; pip3 install wheel; pip3 install meson${meson_ver}
+ build_options_meson: -Dwith-proxy=yes -Dwith-bot=yes -Dwith-perl=yes -Dwith-otr=yes
+ prefix: ~/irssi-build
+jobs:
+ dist:
+ runs-on: ubuntu-latest
+ env:
+ meson_ver: <0.63.0
+ setuptools_ver: <66
+ steps:
+ - name: prepare required software
+ run: |
+ sudo apt update && sudo apt install $apt_build_deps
+ eval "$get_pip_build_deps_meson"
+ patch ~/.local/lib/python3.12/site-packages/pkg_resources/__init__.py <<- PATCH
+ --- __init__.py 2024-12-16 20:37:46.733230351 +0100
+ +++ __init__.py 2024-12-16 20:38:42.479554540 +0100
+ @@ -2188,7 +2188,8 @@ def resolve_egg_link(path):
+ return next(dist_groups, ())
+
+
+ -register_finder(pkgutil.ImpImporter, find_on_path)
+ +if hasattr(pkgutil, 'ImpImporter'):
+ + register_finder(pkgutil.ImpImporter, find_on_path)
+
+ if hasattr(importlib_machinery, 'FileFinder'):
+ register_finder(importlib_machinery.FileFinder, find_on_path)
+ @@ -2345,7 +2346,8 @@ def file_ns_handler(importer, path_item,
+ return subpath
+
+
+ -register_namespace_handler(pkgutil.ImpImporter, file_ns_handler)
+ +if hasattr(pkgutil, 'ImpImporter'):
+ + register_namespace_handler(pkgutil.ImpImporter, file_ns_handler)
+ register_namespace_handler(zipimport.zipimporter, file_ns_handler)
+
+ if hasattr(importlib_machinery, 'FileFinder'):
+ PATCH
+ - uses: actions/checkout@main
+ - name: make dist
+ run: |
+ ./utils/make-dist.sh
+ - uses: actions/upload-artifact@v4
+ with:
+ path: irssi-*.tar.gz
+ retention-days: 1
+ install:
+ runs-on: ${{ matrix.os }}
+ env:
+ CC: ${{ matrix.compiler }}
+ needs: dist
+ continue-on-error: ${{ contains(matrix.flags, 'FAILURE-OK') }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-22.04, ubuntu-latest]
+ compiler: [clang, gcc]
+ flags: [regular]
+ setuptools_ver: [<66]
+ include:
+ - os: ubuntu-22.04
+ meson_ver: ==0.53.2
+ setuptools_ver: <51
+ - os: ubuntu-latest
+ meson_ver: <0.63.0
+ - os: ubuntu-latest
+ flags: meson-latest FAILURE-OK
+ steps:
+ - name: fetch dist
+ uses: actions/download-artifact@v4
+ - name: set PATH
+ run: |
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+ - name: prepare required software
+ env:
+ meson_ver: ${{ matrix.meson_ver }}
+ setuptools_ver: ${{ matrix.setuptools_ver }}
+ run: |
+ sudo apt update && sudo apt install $apt_build_deps
+ eval "$get_pip_build_deps_meson"
+ 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
+ run: tar xaf artifact/irssi-*.tar.gz
+ - name: build and install with meson
+ run: |
+ # ninja install
+ cd irssi-*/
+ meson Build $build_options_meson --prefix=${prefix/\~/~}
+ ninja -C Build
+ ninja -C Build install
+ - name: run tests with Meson
+ run: |
+ # ninja test
+ cd irssi-*/
+ ninja -C Build test
+ find -name testlog.txt -exec sed -i -e '/Inherited environment:.* GITHUB/d' {} + -exec cat {} +
+ - name: run launch test
+ env:
+ TERM: xterm
+ run: |
+ # automated irssi launch test
+ cd
+ mkdir irssi-test
+ echo 'echo automated irssi launch test
+ ^set settings_autosave off
+ ^set -clear log_close_string
+ ^set -clear log_day_changed
+ ^set -clear log_open_string
+ ^set log_timestamp *
+ ^window log on
+ load irc
+ load dcc
+ load flood
+ load notifylist
+ load perl
+ load otr
+ load proxy
+ ^quit' > irssi-test/startup
+ irssi-build/bin/irssi --home irssi-test | perl -Mutf8 -C ~/render.pl
+ cat irc.log.*
+ annotation-warnings:
+ runs-on: ubuntu-latest
+ if: ${{ github.event_name == 'pull_request' }}
+ env:
+ CC: clang
+ steps:
+ - name: prepare required software
+ run: |
+ sudo apt update && sudo apt install $apt_build_deps
+ - uses: actions/checkout@main
+ - name: Setup local annotations
+ uses: irssi-import/actions-irssi/problem-matchers@master
+ - name: set PATH
+ run: |
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
+ - name: prepare required software
+ env:
+ meson_ver: ${{ matrix.meson_ver }}
+ setuptools_ver: ${{ matrix.setuptools_ver }}
+ run: |
+ sudo apt update && sudo apt install $apt_build_deps
+ eval "$get_pip_build_deps_meson"
+ curl -SLf https://github.com/irssi-import/actions-irssi/raw/master/check-irssi/render.pl -o ~/render.pl && chmod +x ~/render.pl
+ - name: build and install with meson
+ run: |
+ meson Build $build_options_meson --prefix=${prefix/\~/~}
+ ninja -C Build
+ ninja -C Build install >/dev/null
+ - name: run launch test
+ env:
+ TERM: xterm
+ run: |
+ # automated irssi launch test
+ cd
+ mkdir irssi-test
+ echo 'echo automated irssi launch test
+ ^set settings_autosave off
+ ^set -clear log_close_string
+ ^set -clear log_day_changed
+ ^set -clear log_open_string
+ ^set log_timestamp *
+ ^window log on
+ load irc
+ load dcc
+ load flood
+ load notifylist
+ load perl
+ load otr
+ load proxy
+ ^quit' > irssi-test/startup
+ irssi-build/bin/irssi --home irssi-test | perl -Mutf8 -C ~/render.pl
+ cat irc.log.*
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml
new file mode 100644
index 00000000..3b20e427
--- /dev/null
+++ b/.github/workflows/cifuzz.yml
@@ -0,0 +1,51 @@
+name: CIFuzz
+on:
+ pull_request:
+ paths:
+ - 'src/core/**/*.c'
+ - 'src/fe-common/core/**/*.c'
+ - 'src/fe-text/gui-*.c'
+ - 'src/irc/**/*.c'
+ - 'src/fe-common/irc/**/*.c'
+ - 'src/lib-config/**/*.c'
+ - 'src/fe-fuzz/**/*.c'
+ - 'tests/**/*.c'
+ - '.github/workflows/cifuzz.yml'
+jobs:
+ Fuzzing:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ sanitizer: [address, undefined, memory]
+ steps:
+ - uses: actions/checkout@main
+ with:
+ path: irssi
+ - name: Docker build build_fuzzers container
+ run: |
+ # google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
+ docker build -t build_fuzzers:actions -f "/home/runner/work/_actions/google/oss-fuzz/master/infra/build_fuzzers.Dockerfile" "/home/runner/work/_actions/google/oss-fuzz/master/infra"
+ - name: Build Fuzzers (${{ matrix.sanitizer }})
+ id: build
+ env:
+ OSS_FUZZ_PROJECT_NAME: 'irssi'
+ DRY_RUN: false
+ SANITIZER: ${{ matrix.sanitizer }}
+ PROJECT_SRC_PATH: /github/workspace/irssi
+ REPOSITORY: 'irssi'
+ run: |
+ docker run --workdir /github/workspace --rm -e OSS_FUZZ_PROJECT_NAME -e DRY_RUN -e SANITIZER -e PROJECT_SRC_PATH -e REPOSITORY -e WORKSPACE=/github/workspace -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "$GITHUB_WORKSPACE":"/github/workspace" build_fuzzers:actions
+ - name: Run Fuzzers (${{ matrix.sanitizer }})
+ uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
+ with:
+ oss-fuzz-project-name: 'irssi'
+ fuzz-seconds: 600
+ dry-run: false
+ sanitizer: ${{ matrix.sanitizer }}
+ - name: Upload Crash
+ uses: actions/upload-artifact@v4
+ if: failure() && steps.build.outcome == 'success'
+ with:
+ name: ${{ matrix.sanitizer }}-artifacts
+ path: ./out/artifacts
diff --git a/.github/workflows/clangformat.yml b/.github/workflows/clangformat.yml
new file mode 100644
index 00000000..55aca4f3
--- /dev/null
+++ b/.github/workflows/clangformat.yml
@@ -0,0 +1,29 @@
+on: [pull_request]
+name: clang-format
+jobs:
+ check-clang-format:
+ runs-on: ubuntu-22.04
+ steps:
+ - name: install clang-format
+ run: sudo apt install clang-format-14
+ - uses: actions/checkout@main
+ - name: fetch target ref
+ run:
+ |
+ refs=($(git log -1 --format=%s))
+ git fetch --depth=1 origin "${refs[3]}"
+ - name: configure clang-format
+ run:
+ |
+ git config clangformat.binary $PWD/utils/clang-format-xs/clang-format-xs
+ git config clangformat.extensions c,h,xs
+ - name: run git-clang-format and Check if no changes are needed
+ run:
+ |
+ CLANG_FORMAT=clang-format-14 git-clang-format-14 --diff FETCH_HEAD HEAD | tee git-clang-format.diff
+ cmp -s <(echo no modified files to format) git-clang-format.diff || cmp -s <(echo -n) git-clang-format.diff
+ - uses: actions/upload-artifact@v4
+ if: failure()
+ with:
+ name: git-clang-format.diff
+ path: git-clang-format.diff
diff --git a/.github/workflows/muon-fmt.yml b/.github/workflows/muon-fmt.yml
new file mode 100644
index 00000000..6fa06d38
--- /dev/null
+++ b/.github/workflows/muon-fmt.yml
@@ -0,0 +1,32 @@
+name: Format meson files
+
+on:
+ push:
+ pull_request:
+
+permissions: {}
+
+jobs:
+ muon-meson-fmt:
+ name: Format
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@main
+ with:
+ persist-credentials: false
+
+ # Build from source because Ubuntu 24.04 apt only has muon 0.2.0.
+ # Newer muons seem to format differently.
+ - name: Build muon from source
+ run: |
+ git clone --depth 1 --branch 0.5.0 https://github.com/muon-build/muon /tmp/muon
+ cd /tmp/muon
+ ./bootstrap.sh build
+ build/muon-bootstrap setup build
+ build/muon-bootstrap -C build samu
+ sudo build/muon -C build install
+
+ - name: Run muon fmt
+ run: |
+ find . -name meson.build -print0 | xargs -0 muon fmt -c .muon_fmt.ini -i
+ git diff --exit-code
diff --git a/.github/workflows/solarisvm.yml b/.github/workflows/solarisvm.yml
new file mode 100644
index 00000000..da1ffa17
--- /dev/null
+++ b/.github/workflows/solarisvm.yml
@@ -0,0 +1,104 @@
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ workflow_dispatch:
+name: Check Irssi on Solaris
+env:
+ get_pip_build_deps_meson: pip3 install setuptools${setuptools_ver}; pip3 install wheel
+ prefix: ~/irssi-build
+jobs:
+ dist:
+ runs-on: ubuntu-latest
+ env:
+ setuptools_ver: <66
+ steps:
+ - name: prepare required software
+ run: |
+ sudo apt update && sudo apt install $apt_build_deps
+ eval "$get_pip_build_deps_meson"
+ patch ~/.local/lib/python3.12/site-packages/pkg_resources/__init__.py <<- PATCH
+ --- __init__.py 2024-12-16 20:37:46.733230351 +0100
+ +++ __init__.py 2024-12-16 20:38:42.479554540 +0100
+ @@ -2188,7 +2188,8 @@ def resolve_egg_link(path):
+ return next(dist_groups, ())
+
+
+ -register_finder(pkgutil.ImpImporter, find_on_path)
+ +if hasattr(pkgutil, 'ImpImporter'):
+ + register_finder(pkgutil.ImpImporter, find_on_path)
+
+ if hasattr(importlib_machinery, 'FileFinder'):
+ register_finder(importlib_machinery.FileFinder, find_on_path)
+ @@ -2345,7 +2346,8 @@ def file_ns_handler(importer, path_item,
+ return subpath
+
+
+ -register_namespace_handler(pkgutil.ImpImporter, file_ns_handler)
+ +if hasattr(pkgutil, 'ImpImporter'):
+ + register_namespace_handler(pkgutil.ImpImporter, file_ns_handler)
+ register_namespace_handler(zipimport.zipimporter, file_ns_handler)
+
+ if hasattr(importlib_machinery, 'FileFinder'):
+ PATCH
+ - uses: actions/checkout@main
+ - name: make dist
+ run: |
+ ./utils/make-dist.sh
+ - uses: actions/upload-artifact@v4
+ with:
+ path: irssi-*.tar.gz
+ retention-days: 1
+ install:
+ runs-on: ubuntu-latest
+ needs: dist
+ steps:
+ - name: fetch dist
+ uses: actions/download-artifact@v4
+ - name: Test in Solaris
+ uses: vmactions/solaris-vm@v1
+ with:
+ usesh: true
+ sync: rsync
+ release: "11.4-gcc"
+ prepare: |
+ pkg update --accept || echo 1:$?
+ pkg install meson || echo 2:$?
+ pkgutil -y -i curl || echo 3:$?
+ pkgutil -y -i gtar || echo 4:$?
+ pkgutil -y -i findutils || echo 5:$?
+ run: |
+ set -ex
+ export PKG_CONFIG_PATH=/usr/lib/64/pkgconfig
+ curl -SLf https://github.com/irssi-import/actions-irssi/raw/master/check-irssi/render.pl -o ~/render.pl && chmod +x ~/render.pl
+ gtar xzf artifact/irssi-*.tar.gz
+ # ninja install
+ cd irssi-*/
+ meson Build -Dwith-proxy=yes -Dwith-bot=yes -Dwith-perl=yes --prefix=$HOME/irssi-build
+ ninja -C Build
+ ninja -C Build install
+ # ninja test
+ ninja -C Build test
+ gfind -name testlog.txt -exec gsed -i -e '/Inherited environment:.* GITHUB/d' {} + -exec cat {} +
+ export TERM=xterm
+ # automated irssi launch test
+ cd
+ mkdir irssi-test
+ echo 'echo automated irssi launch test
+ ^set settings_autosave off
+ ^set -clear log_close_string
+ ^set -clear log_day_changed
+ ^set -clear log_open_string
+ ^set log_timestamp *
+ ^window log on
+ load irc
+ load dcc
+ load flood
+ load notifylist
+ load perl
+ load otr
+ load proxy
+ ^quit' > irssi-test/startup
+ irssi-build/bin/irssi --home irssi-test | perl -Mutf8 -C ~/render.pl
+ cat irc.log.*
diff --git a/.github/workflows/termuxpkg.yml b/.github/workflows/termuxpkg.yml
new file mode 100644
index 00000000..23f35695
--- /dev/null
+++ b/.github/workflows/termuxpkg.yml
@@ -0,0 +1,79 @@
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+name: Build Irssi Termux package
+jobs:
+ termux-package:
+ runs-on: ubuntu-latest
+ steps:
+ - name: checkout termux-packages
+ uses: actions/checkout@main
+ with:
+ repository: termux/termux-packages
+ - name: checkout irssi
+ uses: actions/checkout@main
+ with:
+ path: src.irssi.git
+ - name: download termux docker container
+ uses: docker://termux/package-builder:latest
+ - name: create irssi build receipe
+ run: |
+ mkdir packages/irssi-an
+ cat << 'BUILD_SH' > packages/irssi-an/build.sh
+ TERMUX_PKG_HOMEPAGE=https://irssi.org/
+ TERMUX_PKG_DESCRIPTION="Terminal based IRC client"
+ TERMUX_PKG_LICENSE="GPL-2.0"
+ TERMUX_PKG_MAINTAINER="@irssi"
+ TERMUX_PKG_VERSION=@VERSION@
+ TERMUX_PKG_REVISION=@REVISION@
+ TERMUX_PKG_SRCURL=git+file:///home/builder/termux-packages/src.irssi.git
+ TERMUX_PKG_AUTO_UPDATE=true
+ TERMUX_PKG_DEPENDS="glib, libandroid-glob, libiconv, libotr, ncurses, openssl, perl, utf8proc"
+ TERMUX_PKG_BREAKS="irssi"
+ TERMUX_PKG_REPLACES="irssi"
+ TERMUX_MESON_PERL_CROSS_FILE=$TERMUX_PKG_TMPDIR/meson-perl-cross-$TERMUX_ARCH.txt
+ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
+ -Dfhs-prefix=$TERMUX_PREFIX
+ --cross-file $TERMUX_MESON_PERL_CROSS_FILE
+ "
+
+ termux_step_pre_configure() {
+ LDFLAGS+=" -landroid-glob"
+
+ # Make build log less noisy.
+ CFLAGS+=" -Wno-compound-token-split-by-macro"
+
+ local perl_version=$(. $TERMUX_SCRIPTDIR/packages/perl/build.sh; echo $TERMUX_PKG_VERSION)
+
+ cat << MESON_PERL_CROSS >$TERMUX_MESON_PERL_CROSS_FILE
+ [properties]
+ perl_version = '$perl_version'
+ perl_ccopts = ['-I$TERMUX_PREFIX/include', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-I$TERMUX_PREFIX/lib/perl5/$perl_version/${TERMUX_ARCH}-android/CORE']
+ perl_ldopts = ['-Wl,-E', '-I$TERMUX_PREFIX/include', '-L$TERMUX_PREFIX/lib/perl5/$perl_version/${TERMUX_ARCH}-android/CORE', '-lperl', '-lm', '-ldl']
+ perl_archname = '${TERMUX_ARCH}-android'
+ perl_installsitearch = '$TERMUX_PREFIX/lib/perl5/site_perl/$perl_version/${TERMUX_ARCH}-android'
+ perl_installvendorarch = ''
+ perl_inc = ['$TERMUX_PREFIX/lib/perl5/site_perl/$perl_version/${TERMUX_ARCH}-android', '$TERMUX_PREFIX/lib/perl5/site_perl/$perl_version', '$TERMUX_PREFIX/lib/perl5/$perl_version/${TERMUX_ARCH}-android', '$TERMUX_PREFIX/lib/perl5/$perl_version']
+ MESON_PERL_CROSS
+ }
+
+ BUILD_SH
+ version=$(awk '/^v/ { $0=$1; gsub(/^v/,""); gsub(/-head/,"dev"); gsub(/-/,""); print; exit }' src.irssi.git/NEWS)
+ version=$version+g$(git -C src.irssi.git rev-parse --short HEAD)
+ sed -i \
+ -e "s:@VERSION@:$version:" \
+ -e "s:@REVISION@:$GITHUB_RUN_NUMBER:" \
+ packages/irssi-an/build.sh
+ git -C src.irssi.git tag v$version
+ - name: prepare output folder
+ run: |
+ install -m a+rwx -d output
+ - name: build irssi package
+ run: |
+ sudo ./scripts/run-docker.sh ./build-package.sh -I irssi-an
+ - uses: actions/upload-artifact@v4
+ with:
+ name: irssi-termux-pkg
+ path: output/irssi-an*.deb
diff --git a/.github/workflows/trigger-pages.yml b/.github/workflows/trigger-pages.yml
new file mode 100644
index 00000000..0f2d3212
--- /dev/null
+++ b/.github/workflows/trigger-pages.yml
@@ -0,0 +1,20 @@
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ rebuild-pages:
+ if: github.repository == 'irssi/irssi'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/github-script@v6
+ with:
+ github-token: ${{ secrets.PAT_TOKEN }}
+ script: |
+ await github.rest.actions.createWorkflowDispatch({
+ owner: context.repo.owner,
+ repo: 'irssi.github.io',
+ workflow_id: 'pages.yml',
+ ref: 'main'
+ })
diff --git a/.github/workflows/voiddocker.yml b/.github/workflows/voiddocker.yml
new file mode 100644
index 00000000..9dc2addf
--- /dev/null
+++ b/.github/workflows/voiddocker.yml
@@ -0,0 +1,75 @@
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ workflow_dispatch:
+name: Check Irssi on Void Linux glibc
+jobs:
+ dist:
+ runs-on: ubuntu-latest
+ container: ghcr.io/void-linux/void-glibc:latest
+ steps:
+ - name: prepare required software
+ run: |
+ xbps-install -Syu xbps || :
+ xbps-install -Syu
+ xbps-install -Sy git findutils python3-setuptools tar xz gzip
+ - uses: actions/checkout@main
+ - name: make dist
+ run: |
+ git config --global --add safe.directory /__w/irssi/irssi
+ ./utils/make-dist.sh
+ - uses: actions/upload-artifact@v4
+ with:
+ path: irssi-*.tar.gz
+ retention-days: 1
+ install:
+ runs-on: ubuntu-latest
+ container: ghcr.io/void-linux/void-glibc:latest
+ needs: dist
+ steps:
+ - name: prepare required software
+ run: |
+ xbps-install -Syu xbps || :
+ xbps-install -Syu
+ xbps-install -Sy meson base-devel libglib-devel libutf8proc-devel ncurses-devel ncurses-base openssl-devel libotr-devel libgcrypt-devel tar findutils curl
+ - name: fetch dist
+ uses: actions/download-artifact@v4
+ - name: Setup local annotations
+ uses: irssi-import/actions-irssi/problem-matchers@master
+ - name: Test on Void Linux glibc
+ run: |
+ set -ex
+ curl -SLf https://github.com/irssi-import/actions-irssi/raw/master/check-irssi/render.pl -o ~/render.pl && chmod +x ~/render.pl
+ tar xzf artifact/irssi-*.tar.gz
+ # ninja install
+ cd irssi-*/
+ meson Build -Dwith-proxy=yes -Dwith-bot=yes -Dwith-perl=yes --prefix=$HOME/irssi-build --buildtype debugoptimized
+ ninja -C Build
+ ninja -C Build install
+ # ninja test
+ ninja -C Build test
+ find -name testlog.txt -exec sed -i -e '/Inherited environment:.* GITHUB/d' {} + -exec cat {} +
+ export TERM=xterm
+ # automated irssi launch test
+ cd
+ mkdir irssi-test
+ echo 'echo automated irssi launch test
+ ^set settings_autosave off
+ ^set -clear log_close_string
+ ^set -clear log_day_changed
+ ^set -clear log_open_string
+ ^set log_timestamp *
+ ^window log on
+ load irc
+ load dcc
+ load flood
+ load notifylist
+ load perl
+ load otr
+ load proxy
+ ^quit' > irssi-test/startup
+ export LC_CTYPE=C.utf8
+ irssi-build/bin/irssi --home irssi-test | perl -Mutf8 -C ~/render.pl
+ cat irc.log.*
diff --git a/.gitignore b/.gitignore
index 945b6cf6..ea2cd7ba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,7 +11,6 @@ config.status
configure
default-config.h
default-theme.h
-faq.txt
irssi-config
irssi-config.h
irssi-config.h.in
@@ -28,13 +27,14 @@ MYMETA.*
docs/help/Makefile.am
docs/help/[a-z]*
+!docs/help/meson.build
!docs/help/in
docs/help/in/Makefile.am
src/fe-text/irssi
-
-src/fe-common/irc/irc-modules.c
-src/irc/irc.c
+src/fe-fuzz/irssi-fuzz
+src/fe-fuzz/irc/core/event-get-params-fuzz
+src/fe-fuzz/fe-common/core/theme-load-fuzz
src/perl/perl-signals-list.h
src/perl/irssi-core.pl.h
@@ -46,11 +46,35 @@ src/perl/ui/*.c
src/perl/*/MYMETA.*
src/perl/*/Makefile.old
+src/fe-fuzz/crash-*
+src/fe-fuzz/oom-*
+
+/core
+/irssi-1.pc
+/irssi/
+/tests/fe-common/core/test-formats
+/tests/fe-common/core/test-formats.log
+/tests/fe-common/core/test-formats.trs
+/tests/fe-common/core/test-suite.log
+/tests/irc/core/core
+/tests/irc/core/test-channel-events
+/tests/irc/core/test-channel-events.log
+/tests/irc/core/test-channel-events.trs
+/tests/irc/core/test-irc
+/tests/irc/core/test-irc.log
+/tests/irc/core/test-irc.trs
+/tests/irc/core/test-suite.log
+/tests/irc/flood/test-796
+/tests/irc/flood/test-796.log
+/tests/irc/flood/test-796.trs
+/tests/irc/flood/test-suite.log
+
*.a
*.bs
*.la
*.lo
*.o
+*.swp
*~
*.tar.bz2
@@ -58,3 +82,10 @@ src/perl/*/Makefile.old
.deps
.libs
+
+Build
+subprojects/*
+!subprojects/*.wrap
+Irssi-Dist
+setup.cfg
+*.egg-info
diff --git a/.muon_fmt.ini b/.muon_fmt.ini
new file mode 100644
index 00000000..47fce5d2
--- /dev/null
+++ b/.muon_fmt.ini
@@ -0,0 +1,14 @@
+# Irssi configuration for muon fmt
+max_line_len = 108
+indent_style = space
+indent_size = 2
+#indent_by = ' '
+space_array = true
+kwargs_force_multiline = true
+wide_colon = true
+no_single_comma_function = true
+insert_final_newline = true
+sort_files = false
+group_arg_value = true
+sticky_parens = true
+continuation_indent = true
diff --git a/.obs/workflows.yml b/.obs/workflows.yml
new file mode 100644
index 00000000..de815226
--- /dev/null
+++ b/.obs/workflows.yml
@@ -0,0 +1,13 @@
+workflow:
+ steps:
+ - branch_package:
+ source_project: home:ailin_nemui:irssi-git-an
+ source_package: irssi-git-an
+ target_project: home:ailin_nemui:CI
+ - set_flags:
+ flags:
+ - type: publish
+ status: enable
+ project: home:ailin_nemui:CI
+ filters:
+ event: pull_request
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 804dc58c..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-sudo: false
-language: perl
-perl:
- - "5.20-shrplib"
- - "5.18-shrplib"
- - "system-perl"
-env:
- - CC=clang
- - CC=gcc
-
-addons:
- apt:
- packages:
- - libperl-dev
- - elinks
-
-before_install:
- - perl -V
- - ./autogen.sh --with-proxy --with-bot --with-perl=module
- - make dist
- - cd ..
- - tar xaf */irssi-*.tar.*
- - cd irssi-*
-
-install:
- - ./configure --with-proxy --with-bot --with-perl=module --prefix=$HOME/irssi-build
- - make CFLAGS="-Wall -Werror"
- - make install
-
-before_script:
- - cd
- - mkdir irssi-test
- - echo echo automated irssi launch test > irssi-test/startup;
- echo ^set settings_autosave off >> irssi-test/startup;
- echo ^set -clear log_close_string >> irssi-test/startup;
- echo ^set -clear log_day_changed >> irssi-test/startup;
- echo ^set -clear log_open_string >> irssi-test/startup;
- echo ^set log_timestamp '* ' >> irssi-test/startup;
- echo ^window log on >> irssi-test/startup
- - echo load perl >> irssi-test/startup
- - echo load proxy >> irssi-test/startup
- - echo ^quit >> irssi-test/startup
- - irssi-build/bin/irssi --home irssi-test
- - cat irc.log.*
-
-script: true
diff --git a/AUTHORS b/AUTHORS
index eea359cc..db5ad2de 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -13,6 +13,7 @@ Irssi staff (current maintainers) Internet Relay Chat was created in 1988 and has hardly changed. It can be used to exchange text messages (one message = single line) with other people, either privately (called query, PM, private message, MSG) or in a room (channel). Pictures are shared by uploading them to a temporary host like https://pomf.lain.la/ and then pasting the HTTP links. Code snippets or longer texts are shared by pasting them to a Pastebin like https://paste.opensuse.org/ and then sharing the HTTP link. IRC does not have message history. You can only receive replies while your computer is turned on and connected to the channel you want to follow. Some people run their IRC programs on remote servers for that reason. IRC is organised into networks. Each network consists of many servers. It (mostly) does not matter which server you connect to as long as it belongs to the network you want to use. Irssi supports connections to many networks at the same time. Each network contains many channels, rooms that are often dedicated to discussing a specific topic. You can find many channels on https://netsplit.de/ or using a search engine with the keyword “IRC”. Irssi supports joining many channels at the same time. There is a rather large IRC network catering to free and open-source software and peer directed projects at https://libera.chat/ and a smaller one at https://www.oftc.net/ – many free software projects still have support channels on these IRC networks (although some have moved to Matrix or proprietary platforms like Discord). After (compiling and) installing Irssi, to start it, open a shell (Terminal) and type: You should be greeted by a blinking cursor behind If you’re confused about what you are seeing on the Irssi screen, you can find an annotated screenshot of it at User interface. If you want, you can pick a nick name (handle) that will be shown to others reading your messages now, by typing Each command or message can be sent by pressing Enter. Commands in Irssi start with a Type Irssi comes with some predefined networks. You can see the current list of networks by typing (the list will be shown in your status window) To connect to one of the networks in the list, type You should see several messages scroll by. After a while, you should be connected to the Libera Chat network. Attention Irssi version 1.2 or older may be lacking the liberachat network entry. See https://github.com/shabble/irssi-docs/wiki/liberachat for how to add it. Many IRC networks (but not all) offer a way to register a user account. Sometimes (but not on all networks) the account registration also includes reserving a nick for you. How to register also differs by network. Some channels only allow users with registered accounts to join them, so it may be very important for you to register a user account. User accounts are always specific to a network. For the Libera Chat network, you can find instructions how to register and set up your account with Irssi on https://github.com/shabble/irssi-docs/wiki/liberachat#configure-sasl-automated-log-in Once you are connected to a network, you can join channels by typing Now, a new window will open and you can send messages to the channel. You can change between windows using the By default, Irssi shows when someone joins or leaves a channel. These messages can waste a lot of lines and obscure the actual chat. To hide them, type To get them back If you want to hide them by default, If you want to join a network that is not there, you first need to find at least one server of that network. Let’s say you have found the room #hackint on netsplit.de and want to join it. Then you can find that the server is irc.hackint.org, port 6697, SSL (TLS) on. To add it to Irssi, use the commands: Then, you can connect to the newly added network with If you are connected to multiple networks, you can change which one you are “talking” to (which one to send commands) by using the Most /commands have a help page, you can read it with or on-line. The settings that can be changed with /SET are described on Settings Documentation – the settingshelp script can be used to read it from within You can enhance your Irssi by installing scripts. Many Perl scripts written by other Irssi users can be found on https://scripts.irssi.org/ Most of them should be compatible with Irssi 1.4 (but some may not, also see the Full Change log for some incompatible ones) Irssi’s look can be thoroughly changed with themes. Many themes created by other Irssi users can be found on https://themes.irssi.org/ If you want to modify the look of Irssi yourself, the default theme which can be found in your Irssi’s hierarchy is something like this: (IRC, ICQ, xxx and yyy are chat protocols ..) (sub1 and sub2 are submodules of IRC module, like DCC and flood protect) Chat protocols and frontends are kept in separate modules. Common UI
+and GUI modules also have the common parts which don’t know anything
+about the chat protocols. This should allow implementing modules to
+whatever chat protocols and with whatever frontends easily. Communication between different modules are done with “signals”. They are
+not related to UNIX signals in any way, you could more like think of them
+as “events” - which might be a better name for them, but I don’t really
+want to change it anymore :) So, you send signal with Sends a “mysignal” function with one argument “hello” - before that, you
+should have grabbed the signal somewhere else with: There are three different Emitting signal with it’s name creates a small overhead since it has to
+look up the signal’s numeric ID first, after which it looks up the signal
+structure. This is done because if you call a signal really often,
+it’s faster to find it with it’s numeric ID instead of the string. You
+can use See Irssi depends on this for reading and saving configuration.
+(created by me for irssi) Provides some functionality that all other modules can use: 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. 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. 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. A: You can disable the status window, or do A: You can disable the status window, or do A: Check here A: Check here To create a “tabular” effect of the chat view, or to align nick names in a column, you can use Irssi’s theme/format system. The basic commands are the following: These are copied from the default theme’s default values, which are responsible for displaying your own messages sent to a channel ( Then, in front of the argument that contains the nick name ( Note: Modifiers only work in the There are also some scripts that try to do the alignment for you, like: There are also some nice themes that extend the alignment to further formats, like: weed. Please check here => Automatic log-in to NickServ CertFP, short for Certificate Finger Print, is another method to log you in to NickServ. Instead of a password, it uses a Client Certificate. In order to use it, you first need a certificate, then configure Irssi to use this certificate, and finally register the certificate with NickServ. Irssi does not have built-in certificate management commands, so you need to use an external tool like A step-by-step guide for the Libera Chat network can be found here => https://github.com/shabble/irssi-docs/wiki/liberachat_certfp It is necessary that the certificate be available as a file; PKCS#11 is not supported. Tor is an overlay network for anonymous communication. It operates a local SOCKS proxy for applications to use. Unfortunately, Irssi currently does not support SOCKS proxies natively. As a workaround, you can install the ProxyChains-NG program (note, it must be the NG version). Afterwards, you can launch Irssi like this: Now your connections will go through the Proxy configured in ProxyChains-NG (Tor by default). IRC networks may have different requirements to be able to connect via Tor. For the Libera Chat network, you will first need to set up CertFP Log-in using a clearnet connection, and then connect to their Onion Service If you see such a message this means that the automatic signing key used by the Open Build Service expired. OBS renews the key periodically, but Debian does not support this. Download the key again, following the regular OBS instructions. If it still does not work, verify if there is a second expired copy of the key in Copyright (c) 2000-2002 by Timo Sirainen, release under GNU FDL 1.1 license. Copyright (c) 2000-2002 by Timo Sirainen, release under GNU FDL 1.1 license. Index with some FAQ questions that are answered in the chapter: These settings should give you pretty good defaults (the ones I use): IRC Networks are made of servers, and servers have channels. The default config has a few predefined networks, to list them: If colors don’t work, and you know you’re not going to use some weird non-VT compatible terminal (you most probably aren’t), just say: And to connect to one of those networks and join a channel: I don’t like automatic query windows, I don’t like status window, I do like msgs window where all messages go: To add more networks: Disable automatic window closing when Then add some servers (with -auto to automatically connect): Here’s the settings that make irssi work exactly like ircII in window management (send me a note if you can think of more): Automatically join to channels after connected to server: And example how to add servers: To modify existing networks (or servers, or channels) just ADD again using the same name as before. This configures a network to identify with nickserv and wait for 2 seconds before joining channels: (OFTC network, identify with nickserv and wait for 2 seconds before joining channels) If you have irssi 0.8.18 or higher and the irc network supports it, you can use SASL instead of nickserv, which is more reliable: (NOTE: use /IRCNET with 0.8.9 and older) Then add some servers to different networks (network is already set up for them), irc.kpnqwest.fi is used by default for IRCNet but if it fails, irc.funet.fi is tried next: These commands have many more options, see their help for details: Automatically join to channels after connected to server, send op request to bot after joined to efnet/#irssi: If you want lines containing your nick to hilight: Or, for irssi 0.8.18 or higher: To get beeps on private messages or highlights: No other irssi settings are needed (don’t enable bell_beeps), but there may be settings to change in your terminal multiplexer (screen/tmux), your terminal, or your desktop environment. 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 By default, irssi uses “hidden windows” for everything. Hidden window is created every time you By default, irssi uses “hidden windows” for everything. Hidden windows are created every time you Clearly the easiest way is to use Meta-number keys. And what is the Meta key? ESC key always works as Meta, but there’s also easier ways. ALT could work as Meta, or if you have Windows keyboard, left Windows key might work as Meta. If they don’t work directly, you’ll need to set a few X resources (NOTE: these work with both xterm and rxvt): Clearly the easiest way is to use Meta-number keys. Meta usually means the ALT key, but if that doesn’t work, you can use ESC. Mac OS X users with ALT key issues might prefer using iTerm2 instead of the default terminal emulator. If you use xterm or rxvt, you may need to set a few X resources: With rxvt, you can also specify which key acts as Meta key. So if you want to use ALT instead of Windows key for it, use: You could do this by changing the X key mappings: And how exactly do you set these X resources? For Debian, there’s Many windows SSH clients also don’t allow usage of ALT. One excellent client that does allow is putty, you can download it from http://www.chiark.greenend.org.uk/~sgtatham/putty/. Note: this guide might be a better introduction to window splits Irssi also supports split windows, they’ve had some problems in past but I think they should work pretty well now :) Here’s some commands related to them: By default, irssi uses “sticky windowing” for split windows. This means that windows created inside one split window cannot be moved to another split window without some effort. For example you could have following window layout: When you are in win#1 and press ALT-6, irssi jumps to split window #3 and moves the efnet/#channel2 the active window. With non-sticky windowing the windows don’t have any relationship with split windows, pressing ALT-6 in win#1 moves win#6 to split window 1 and sets it active, except if win#6 was already visible in some other split window irssi just changes to that split window. This it the way windows work with ircii, if you prefer it you can set it with Each window can have multiple channels, queries and other “window items” inside them. If you don’t like windows at all, you disable automatic creating of them with And if you keep all channels in one window, you most probably want the channel name printed in each line: If you want to group only some channels or queries in one window, use Irssi’s multiple IRC network support is IMHO very good - at least compared to other clients :) Even if you’re only in one IRC network you should group all your servers to be in the same IRC network as this 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. First you need to have your IRC network set, use First you need to have your IRC network set, use After that you need to add your servers. For example: The And finally channels: First connect to all the servers, join the channels and create the queries you want. If you want to move the windows or channels around use commands: When everything looks the way you like, use By default, all the “extra messages” go to status window. This means pretty much all messages that don’t clearly belong to some channel or query. Some people like it, some don’t. If you want to remove it, use This doesn’t have any effect until you restart irssi. If you want to remove it immediately, just Another common window is “messages window”, where all private messages go. By default it’s disabled and query windows are created instead. To make all private messages go to msgs window, say: use_msgs_window either doesn’t have any effect until restarting irssi. To create it immediately say: Note that neither use_msgs_window nor use_status_window have any effect at all if This brings us to message levels.. What are they? All messages that irssi prints have one or more “message levels”. Most common are PUBLIC for public messages in channels, MSGS for private messages and CRAP for all sorts of messages with no real classification. You can get a whole list of levels with Status window has message level ircii and several other clients support multiple servers by placing the connection into some window. IRSSI DOES NOT. There is no required relationship between window and server. You can connect to 10 servers and manage them all in just one window, or join channel in each one of them to one single window if you really want to. That being said, here’s how you do connect to new server without closing the old connection: Instead of the Here you see that we’re connected to IRCNet and OFTC networks. The IRCNet at the beginning is called the “server tag” while the (IRCnet) at the end shows the IRC network. Server tag specifies unique tag to refer to the server, usually it’s the same as the IRC network. When the IRC network isn’t known it’s some part of the server name. When there’s multiple connections to same IRC network or server, irssi adds a number after the tag so there could be network, network2, network3 etc. To disconnect one of the servers, or to stop irssi from reconnecting, use Now that you’re connected to all your servers, you’ll have to know how to specify which one of them you want to use. One way is to have an empty window, like status or msgs window. In it, you can specify which server to set active with When the server is active, you can use it normally. When there’s multiple connected servers, irssi adds [servertag] prefix to all messages in non-channel/query messages so you’ll know where it came from. Several commands also accept Window’s server can be made sticky. When sticky, it will never automatically change to anything else, and if server gets disconnected, the window won’t have any active server. When the server gets connected again, it is automatically set active in the window. To set the window’s server sticky use This is useful if you wish to have multiple status or msgs windows, one for each server. Here’s how to do them (repeat for each server) If there’s more than 1000 lines to be printed, irssi thinks that you probably made some mistake and won’t print them without With Irssi can automatically log important messages when you’re set away ( Easiest way to start logging with Irssi is to use autologging. With it Irssi logs all channels and private messages to specified directory. You can turn it on with By default it logs pretty much everything execept CTCPS or CRAP ( By default irssi logs to ~/irclogs/ By default irssi logs to ~/irclogs/<servertag>/<target>.log. You can change this with The path is automatically created if it doesn’t exist. $0 specifies the target (channel/nick). You can make irssi automatically rotate the logs by adding date/time formats to the file name. The formats are in “man strftime” format. For example For logging only some specific channels or nicks, see So in irssi you would use 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 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 to servers irc.dalnet and irc.efnet.org. First you’d need to setup the bouncer: 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 to servers irc.dal.net and irc.efnet.org. First you’d need to setup the bouncer: Then you’ll need to add the server connections. These are done exactly as if you’d want to connect directly to them. Nothing special about them: With the proxy Proxy specific settings: All proxies have these settings in common: All proxies except irssi proxy and socks proxy have these settings in common: HTTP proxy Use these settings with HTTP proxies: BNC dircproxy dircproxy separates the server connections by passwords. So, if you for example have network connection with password ircpass and OFTC connection with oftcpass, you would do something like this: The server name and port you give isn’t used anywhere, so you can put anything you want in there. psyBNC has internal support for multiple servers. However, it could be a bit annoying to use, and some people just use different users for connecting to different servers. You can manage this in a bit same way as with dircproxy, by creating fake connections: So, you’ll specify the usernames with (NOTE: use /IRCNET with 0.8.9 and older.) Irssi proxy Irssi contains it’s own proxy which you can build giving 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. And even more clearly: You can use only one IRC server connection to IRC with as many clients as you want. 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? :) Irssi proxy is a bit different than most proxies, normally proxies create a new connection to IRC server when a new client connects to it, but irssi proxy shares your existing IRC connection(s) to multiple clients. And even more clearly: You can use only one IRC server connection of the irssi proxy to IRC with as many clients as you want. 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? :) Irssi proxy supports sharing multiple server connections in different ports, like you can share network in port 2777 and efnet in port 2778. Usage in proxy side: NOTE: you MUST add all the servers you are using to server and network lists with The special network name Usage in client side: Just connect to the irssi proxy like it is a normal server with password specified in Or, if you used I.e. the network to connect to is specified as part of the password,
-separated by Irssi proxy works fine with other IRC clients as well. SOCKS Irssi can be compiled with socks support ( Using proxychains-ng is recommended for using irssi with a socks proxy. Irssi does not support socks proxy natively. Note that Others IRC bouncers usually work like IRC servers, and want a password. You can give it with: Irssi’s defaults for connect strings are The proxy_string is sent before NICK/USER commands, the proxy_string_after is sent after them. %s and %d can be used with both of them. You probably don’t like Irssi’s default settings. I don’t like them. But I’m still convinced that they’re pretty good defaults. Here’s some of them you might want to change (the default value is shown): Also check the Settings Documentation Here’s some settings you might want to change (the default value is shown): Also check the Settings Documentation QueriesNew users guide
+New to IRC
+First start
+irssi
+
[(status)]. You are now in the status window of Irssi. Window is the Irssi name for what you might nowadays call a “Web browser tab”./set nick whatyouwant
+
/. If there is no /, then the line that you wrote will be sent as a message to the channel that you have open, for everyone to see.Leaving
+/quit to get out of Irssi.Connecting to a network
+/network
+
/connect networkname, for example:/connect liberachat
+
Nickname registration
+Joining a channel
+/join #channelname, for example:/join #irssi
+
Changing windows
+Ctrl+n or Ctrl+p keys, or–if your terminal is configured properly–using Alt+1, Alt+2, … See bind -list for a list of all default key bindings.Removing clutter
+/window hidelevel +joins +parts +quits
+
/window hidelevel -joins -parts -quits
+
/set window_default_hidelevel hidden joins parts quitsAdding a new network
+/network add hackint
+/server add -tls -network hackint irc.hackint.org 6697
+
/connect hackint
+
Multiple networks
+Ctrl+x key in the status window.On-line help
+/help commandname
+
/helpAbout Scripts
+About Themes
+~/.irssi folder is a good starting point. It also has a few comments explaining what some of the abstracts are used forDesign
+
+
+
+ sub1 sub2
+ \ /
+ xxx IRC COMMON ICQ yyy
+ | | | | |
+ '----+-----:-----+----+----'
+ |
+ GUI (gtk/gnome, qt/kde, text, none)
+ |
+ sub1 sub2 |
+ \ / |
+ xxx IRC | COMMON ICQ yyy
+ '----+-----+-----+----+----'
+ |
+ COMMON UI
+ |
+ sub1 sub2 |
+ \ / |
+ xxx IRC | ICQ yyy
+ | | | | |
+ '----+-----+-----+----'
+ |
+ CORE
+ /
+ lib-config
+
+Signals
+
+signal_emit() and it’s sent to all modules that
+have grabbed it by calling signal_add() in their init function. For
+example:signal_emit("mysignal", 1, "hello");
+static void sig_mysignal(const char *arg1)
+{
+ /* arg1 contains "hello" */
+}
+
+signal_add("mysignal", (SIGNAL_FUNC) sig_mysignal);
+signal_add() functions which you can use to
+specify if you want to grab the signal first, “normally” or last. You can
+also stop the signal from going any further.signal_get_uniq_id() macro to convert the signal name into ID -
+you’ll have to do this only once! - and use signal_emit_id() to emit the
+signal. Don’t bother to do this unless your signal is sent (or could be
+sent) several times in a second.src/core/signals.h for definition of the signal function, and
+signals.txt for a list of signals.lib-config
+
+CORE module
+
+
+
+
+COMMON UI module
+
+
+
+
+GUI modules
+
+
+
+
+IRC module
+
+
+
+
+
+
+
+
+
+
+
+
+ IRC UI module
+
+
+
diff --git a/docs/design.txt b/docs/design.txt
index 3f372829..6888f211 100644
--- a/docs/design.txt
+++ b/docs/design.txt
@@ -1,150 +1,139 @@
+Design
- Irssi's hierarchy is something like this:
+Irssi’s hierarchy is something like this:
+
+ sub1 sub2
+ \ /
+ xxx IRC COMMON ICQ yyy
+ | | | | |
+ '----+-----:-----+----+----'
+ |
+ GUI (gtk/gnome, qt/kde, text, none)
+ |
+ sub1 sub2 |
+ \ / |
+ xxx IRC | COMMON ICQ yyy
+ '----+-----+-----+----+----'
+ |
+ COMMON UI
+ |
+ sub1 sub2 |
+ \ / |
+ xxx IRC | ICQ yyy
+ | | | | |
+ '----+-----+-----+----'
+ |
+ CORE
+ /
+ lib-config
- sub1 sub2
- \ /
- xxx IRC COMMON ICQ yyy
- |____|___________|____|____|
- |
- GUI (gtk/gnome, qt/kde, text, none)
- |
- sub1 sub2 |
- \ / |
- xxx IRC | COMMON ICQ yyy
- |____|_____|_____|____|____|
- |
- COMMON UI
- |
- sub1 sub2 |
- \ / |
- xxx IRC | ICQ yyy
- |____|_____|_____|____|
- |
- CORE
- /
- lib-config
+(IRC, ICQ, xxx and yyy are chat protocols ..)
+(sub1 and sub2 are submodules of IRC module, like DCC and flood protect)
- (IRC, ICQ, xxx and yyy are chat protocols ..)
- (sub1 and sub2 are submodules of IRC module, like DCC and flood protect)
+Chat protocols and frontends are kept in separate modules. Common UI and GUI
+modules also have the common parts which don’t know anything about the chat
+protocols. This should allow implementing modules to whatever chat protocols
+and with whatever frontends easily.
+Signals
- Chat protocols and frontends are kept in separate modules. Common UI
- and GUI modules also have the common parts which don't know anything
- about the chat protocols. This should allow implementing modules to
- whatever chat protocols and with whatever frontends easily.
+Communication between different modules are done with “signals”. They are not
+related to UNIX signals in any way, you could more like think of them as
+“events” - which might be a better name for them, but I don’t really want to
+change it anymore :)
- ** Signals
+So, you send signal with signal_emit() and it’s sent to all modules that have
+grabbed it by calling signal_add() in their init function. For example:
- Communication between different modules are done with "signals". They are
- not related to UNIX signals in any way, you could more like think of them
- as "events" - which might be a better name for them, but I don't really
- want to change it anymore :)
+signal_emit("mysignal", 1, "hello");
- So, you send signal with signal_emit() and it's sent to all modules that
- have grabbed it by calling signal_add() in their init function. For
- example:
+Sends a “mysignal” function with one argument “hello” - before that, you should
+have grabbed the signal somewhere else with:
- signal_emit("mysignal", 1, "hello");
+static void sig_mysignal(const char *arg1)
+{
+ /* arg1 contains "hello" */
+}
- Sends a "mysignal" function with one argument "hello" - before that, you
- should have grabbed the signal somewhere else with:
+signal_add("mysignal", (SIGNAL_FUNC) sig_mysignal);
- static void sig_mysignal(const char *arg1)
- {
- /* arg1 contains "hello" */
- }
+There are three different signal_add() functions which you can use to specify
+if you want to grab the signal first, “normally” or last. You can also stop the
+signal from going any further.
- signal_add("mysignal", (SIGNAL_FUNC) sig_mysignal);
+Emitting signal with it’s name creates a small overhead since it has to look up
+the signal’s numeric ID first, after which it looks up the signal structure.
+This is done because if you call a signal really often, it’s faster to find it
+with it’s numeric ID instead of the string. You can use signal_get_uniq_id()
+macro to convert the signal name into ID - you’ll have to do this only once! -
+and use signal_emit_id() to emit the signal. Don’t bother to do this unless
+your signal is sent (or could be sent) several times in a second.
- There are three different signal_add() functions which you can use to
- specify if you want to grab the signal first, "normally" or last. You can
- also stop the signal from going any further.
+See src/core/signals.h for definition of the signal function, and signals.txt
+for a list of signals.
- Emitting signal with it's name creates a small overhead since it has to
- look up the signal's numeric ID first, after which it looks up the signal
- structure. This is done because if you call a signal _really_ often,
- it's faster to find it with it's numeric ID instead of the string. You
- can use signal_get_uniq_id() macro to convert the signal name into ID -
- you'll have to do this only once! - and use signal_emit_id() to emit the
- signal. Don't bother to do this unless your signal is sent (or could be
- sent) several times in a second.
+lib-config
- See src/core/signals.h for definition of the signal function, and
- signals.txt for a list of signals.
+Irssi depends on this for reading and saving configuration. (created by me for
+irssi)
+CORE module
- ** lib-config
+Provides some functionality that all other modules can use:
- Irssi depends on this for reading and saving configuration.
- (created by me for irssi)
+ • signal handling
+ • keeping list of settings
+ • keeping list of /commands
+ • keeping track of loaded modules
+ • networking functions (with nonblocking connects, IPv6 support)
+ • handles connecting to servers
+ • raw logging of server’s input/output data
+ • /EVAL support
+ • fgets() like function line_split() without any maximum line limits
+ • command line parameter handling
+ • miscellaneous useful little functions
+ • handles logging
+COMMON UI module
- ** CORE module
+ • knows basics about windows and window items (=channels, queries, ..)
+ • printtext() - parsing texts and feeding it for GUI to print.
+ • themes
+ • translation tables
+ • text hilighting
+ • command history
+ • user interface (/commands) for CORE’s functionality
- Provides some functionality that all other modules can use:
- - signal handling
- - keeping list of settings
- - keeping list of /commands
- - keeping track of loaded modules
- - networking functions (with nonblocking connects, IPv6 support)
- - handles connecting to servers
- - raw logging of server's input/output data
- - /EVAL support
- - fgets() like function line_split() without any maximum line limits
- - command line parameter handling
- - miscellaneous useful little functions
- - handles logging
+GUI modules
+ • all the rest of the functionality needed for a working client.
- ** COMMON UI module
+IRC module
- - knows basics about windows and window items (=channels, queries, ..)
- - printtext() - parsing texts and feeding it for GUI to print.
- - themes
- - translation tables
- - text hilighting
- - command history
- - user interface (/commands) for CORE's functionality
+ • CORE
+ □ IRC specific /commands
+ □ flood protecting commands sent to server
+ □ creating IRC masks based on nick/address for bans, ignores, etc.
+ □ keeps list of channels, nicks, channel modes, bans, etc.
+ □ keeps list of servers, server settings, irc networks, server
+ reconnections and irc network splits
+ □ redirection of commands’ replies
+ □ lag detection
+ □ ctcp support and flood protection
+ □ Handles ignoring people
+ • DCC
+ □ DCC chat, send and get
+ • FLOOD
+ □ detects private or channel flooding and sends “flood” signal
+ □ automatic ignoring when flooding
+ • NOTIFYLIST
+ □ handles notifylist
+IRC UI module
- ** GUI modules
+ • placing channels and queries in windows
+ • nick completion
+ • printing infomation of some events
- - all the rest of the functionality needed for a working client.
-
-
- ** IRC module
-
- * CORE
-
- - IRC specific /commands
- - flood protecting commands sent to server
- - creating IRC masks based on nick/address for bans, ignores, etc.
- - keeps list of channels, nicks, channel modes, bans, etc.
- - keeps list of servers, server settings, irc networks,
- server reconnections and irc network splits
- - redirection of commands' replies
- - lag detection
- - ctcp support and flood protection
- - Handles ignoring people
-
- * DCC
-
- - DCC chat, send and get
-
- * FLOOD
-
- - detects private or channel flooding and sends "flood" signal
- - automatic ignoring when flooding
-
- * NOTIFYLIST
-
- - handles notifylist
-
-
- ** IRC UI module
-
- - placing channels and queries in windows
- - nick completion
- - printing infomation of some events
diff --git a/docs/example-cross-android-aarch64.txt b/docs/example-cross-android-aarch64.txt
new file mode 100644
index 00000000..caae0383
--- /dev/null
+++ b/docs/example-cross-android-aarch64.txt
@@ -0,0 +1,47 @@
+[binaries]
+ar = 'aarch64-linux-android-ar'
+c = 'aarch64-linux-android-clang'
+cpp = 'aarch64-linux-android-clang++'
+ld = 'aarch64-linux-android-ld'
+pkgconfig = '/home/builder/.termux-build/_cache/android-r20-api-24-v3/bin/aarch64-linux-android-pkg-config'
+strip = 'aarch64-linux-android-strip'
+
+;; you have to substitute 5.30.2 with the Perl version, that can be
+;; obtained by running ` miniperl -e 'print substr $^V, 1' `
+
+perl = ['/home/builder/.termux-build/perl/src/miniperl', '-I/data/data/com.termux/files/usr/lib/perl5/5.30.2/aarch64-android', '-I/data/data/com.termux/files/usr/lib/perl5/5.30.2']
+
+[properties]
+needs_exe_wrapper = true
+c_args = ['-fstack-protector-strong', '-Oz', '-I/data/data/com.termux/files/usr/include']
+cpp_args = ['-fstack-protector-strong', '-Oz', '-I/data/data/com.termux/files/usr/include']
+c_link_args = ['-L/data/data/com.termux/files/usr/lib', '-Wl,-rpath=/data/data/com.termux/files/usr/lib', '-Wl,--enable-new-dtags', '-Wl,--as-needed', '-Wl,-z,relro,-z,now', '-landroid-glob']
+cpp_link_args = ['-L/data/data/com.termux/files/usr/lib', '-Wl,-rpath=/data/data/com.termux/files/usr/lib', '-Wl,--enable-new-dtags', '-Wl,--as-needed', '-Wl,-z,relro,-z,now', '-landroid-glob']
+
+;; if you do not have a cross-perl like miniperl available, you have
+;; to specify the required options by uncommenting the following
+;; properties
+
+;; you can get the proper values by running the commands on your
+;; Android device:
+
+;; ` perl -V::version: `
+; perl_version = '5.30.2'
+;; ` perl -MExtUtils::Embed -o ccopts `
+; perl_ccopts = ['-I/data/data/com.termux/files/usr/include', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-I/data/data/com.termux/files/usr/lib/perl5/5.30.2/aarch64-android/CORE']
+;; ` perl -MExtUtils::Embed -o ldopts `
+; perl_ldopts = ['-Wl,-E', '-I/data/data/com.termux/files/usr/include', '-L/data/data/com.termux/files/usr/lib/perl5/5.30.2/aarch64-android/CORE', '-lperl', '-lm', '-ldl']
+;; ` perl -V::archname: `
+; perl_archname = 'aarch64-android'
+;; ` perl -V::installsitearch: `
+; perl_installsitearch = '/data/data/com.termux/files/usr/lib/perl5/site_perl/5.30.2/aarch64-android'
+;; ` perl -V::installvendorarch: `
+; perl_installvendorarch = ''
+;; ` perl -E 'say for @INC' `
+; perl_inc = ['/data/data/com.termux/files/usr/lib/perl5/site_perl/5.30.2/aarch64-android', '/data/data/com.termux/files/usr/lib/perl5/site_perl/5.30.2', '/data/data/com.termux/files/usr/lib/perl5/5.30.2/aarch64-android', '/data/data/com.termux/files/usr/lib/perl5/5.30.2']
+
+[host_machine]
+cpu_family = 'arm'
+cpu = 'aarch64'
+endian = 'little'
+system = 'android'
diff --git a/docs/faq.html b/docs/faq.html
index 345060dc..7909b5b4 100644
--- a/docs/faq.html
+++ b/docs/faq.html
@@ -1,7 +1,8 @@
+Frequently Asked Questions
-Q: Why doesn’t irssi display colors even when ircii etc. displays them?
+ Q: Why doesn’t irssi display colors even when ircii etc. displays them?
-TERM=xterm-color irssi). If this doesn’t help, then use the evil way of /SET term_force_colors ON.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?
@@ -53,7 +54,7 @@
Q: Will there be /DETACH-like feature?
-Q: How do I run scripts automatically at startup?
@@ -69,7 +70,7 @@
Q: How can I have /WHOIS replies to active window?
-/WINDOW LEVEL -CRAP in it which would also make several other messages show up in active window. You can also use a script./WINDOW LEVEL -CRAP in it which would also make several other messages show up in active window. You can also use a script.Q: How do I add the active network to the statusbar
@@ -77,4 +78,4 @@
Q: How to pronounce Irssi?
-]
+ [-tls_pinned_cert
Right-aligned nicks
+/format own_msg {ownmsgnick $2 {ownnick $[-9]0}}$1
+/format own_msg_channel {ownmsgnick $3 {ownnick $[-9]0}{msgchannel $1}}$2
+/format pubmsg_me {pubmsgmenick $2 {menick $[-9]0}}$1
+/format pubmsg_me_channel {pubmsgmenick $3 {menick $[-9]0}{msgchannel $1}}$2
+/format pubmsg_hilight {pubmsghinick $0 $3 $[-9]1}$2
+/format pubmsg_hilight_channel {pubmsghinick $0 $4 $[-9]1{msgchannel $2}}$3
+/format pubmsg {pubmsgnick $2 {pubnick $[-9]0}}$1
+/format pubmsg_channel {pubmsgnick $3 {pubnick $[-9]0}{msgchannel $1}}$2
+own_msg) as well as received messages (pubmsg) and the two basic highlightings (me and hilight).$0 in most cases, but $1 in pubmsg_hilight), an alignment modifier (see Appendix B: Special Variables and Expandos) has been added: [-9]. This means that the nicks will be right-aligned and truncated to 9 characters./format section of a theme (this may change in the future)nm, nm2.Automatic log-in to NickServ
+CertFP Log-in
+
+
+openssl to create the certificate.Tor (The Onion Router)
+proxychains4 irssi
+
palladium.libera.chat. More detailed instructions can be found here => https://github.com/shabble/irssi-docs/wiki/liberatorThe following signatures were invalid: EXPKEYSIG
+Err:4 home:/ailin_nemui:/irssi-an InRelease
+ The following signatures were invalid: EXPKEYSIG EDB7AED941EEDB57 home:ailin_nemui OBS Project <home:ailin_nemui@build.opensuse.org>
+
Fix
+/etc/apt/trusted.gpg.d or in apt-key list and remove it as well.Startup How-To
-To new Irssi users (not to new IRC users ..)
+Startup How-To
+ To new Irssi users (not to new IRC users ..)
-
-
-
-
-
1. For all the ircII people
+1. First steps
-/NETWORK LIST
+
+ /SET term_force_colors ON
-/CONNECT liberachat
+/JOIN #irssi
+
+ /SET autocreate_own_query OFF
- /SET autocreate_query_level DCCMSGS
- /SET use_status_window OFF
- /SET use_msgs_window ON
-/PARTing channel or /UNQUERYing query:/NETWORK ADD ExampleNet
+
+ /SET autoclose_windows OFF
- /SET reuse_unused_windows ON
-/SERVER ADD -auto -network ExampleNet irc.example.net
+
+ /SET autocreate_own_query OFF
- /SET autocreate_query_level NONE
- /SET use_status_window OFF
- /SET use_msgs_window OFF
- /SET reuse_unused_windows ON
- /SET windows_auto_renumber OFF
+/CHANNEL ADD -auto #lounge ExampleNet
+/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" ExampleNet
+
+ /NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" OFTC
-/NETWORK ADD -sasl_username yourname -sasl_password yourpassword -sasl_mechanism PLAIN liberachat
+
-
- /SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667
- /SERVER ADD -network IRCnet irc.funet.fi 6667
- /SERVER ADD -auto -network efnet efnet.cs.hut.fi 6667
-
+ /CHANNEL ADD -auto #irssi IRCnet
- /CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass" #irssi efnet
-/HELP NETWORK
+/HELP SERVER
+/HELP CHANNEL
+/HELP
+
+ /HILIGHT nick
-/HILIGHT nick
+/SET hilight_nick_matches_everywhere ON
+/SET beep_msg_level MSGS HILIGHT DCCMSGS
+2. Basic user interface usage
/SB HOME and /SB END commands./JOIN a channel or /QUERY someone. There’s several ways you can change between these windows:/JOIN a channel or /QUERY someone. There’s several ways you can change between these windows:
+ Meta-1, Meta-2, .. Meta-0 - Jump directly between windows 1-10
- Meta-q .. Meta-o - Jump directly between windows 11-19
- /WINDOW <number> - Jump to any window with specified number
- Ctrl-P, Ctrl-N - Jump to previous / next window
-Meta-1, Meta-2, .. Meta-0 - Jump directly between windows 1-10
+Meta-q .. Meta-o - Jump directly between windows 11-19
+/WINDOW <number> - Jump to any window with specified number
+Ctrl-P, Ctrl-N - Jump to previous / next window
+ XTerm*eightBitInput: false
+Alt key as meta, for xterm/rxvt users
+
+
+ XTerm*eightBitInput: false
XTerm*metaSendsEscape: true
-
+ rxvt*modifier: alt
- rxvt*modifier: alt
+
+ xmodmap -e "keysym Alt_L = Meta_L Alt_L"
- xmodmap -e "keysym Alt_L = Meta_L Alt_L"
+/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 and 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.Split windows and window items
+
+ /WINDOW NEW - Create new split window
- /WINDOW NEW HIDE - Create new hidden window
- /WINDOW CLOSE - Close split or hidden window
+
+/WINDOW SHRINK [<lines>] - Shrink the split window
+/WINDOW GROW [<lines>] - Grow the split window
+/WINDOW BALANCE - Balance the sizes of all split windows
+/WINDOW NEW - Create new split window
+/WINDOW NEW HIDE - Create new hidden window
+/WINDOW CLOSE - Close split or hidden window
- /WINDOW HIDE [<number>|<name>] - Make the split window hidden window
- /WINDOW SHOW <number>|<name> - Make the hidden window a split window
+/WINDOW HIDE [<number>|<name>] - Make the split window hidden window
+/WINDOW SHOW <number>|<name> - Make the hidden window a split window
- /WINDOW SHRINK [<lines>] - Shrink the split window
- /WINDOW GROW [<lines>] - Grow the split window
- /WINDOW BALANCE - Balance the sizes of all split windows
- Split window 1: win#1 - Status window, win#2 - Messages window
+
+ Split window 1: win#1 - Status window, win#2 - Messages window
Split window 2: win#3 - IRCnet/#channel1, win#4 - IRCnet/#channel2
Split window 3: win#5 - efnet/#channel1, win#6 - efnet/#channel2
-
+ /SET autostick_split_windows OFF
-/SET autostick_split_windows OFF
+
+ /SET autocreate_windows OFF
-/SET autocreate_windows OFF
+
+ /SET print_active_channel ON
-/SET print_active_channel ON
+
+ /JOIN -window #channel
- /QUERY -window nick
-/JOIN -window #channel
+/QUERY -window nick
+3. Server and channel automation
/NETWORK command to see if it’s already there. If it isn’t, use /NETWORK ADD yournetwork. If you want to execute some commands automatically when you’re connected to some network, use -autosendcmd option. (NOTE: use /IRCNET with 0.8.9 and older.) Here’s some examples:/NETWORK command to see if it’s already there. If it isn’t, use /NETWORK ADD yournetwork. If you want to execute some commands automatically when you’re connected to some network, use -autosendcmd option. Here’s some examples:
+ /NETWORK ADD -autosendcmd '^msg bot invite' IRCnet
- /NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" OFTC
-/NETWORK ADD -autosendcmd '^msg bot invite' IRCnet
+/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" OFTC
+
+ /SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667
- /SERVER ADD -auto -network worknet irc.mycompany.com 6667 password
-/SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667
+/SERVER ADD -auto -network worknet irc.mycompany.com 6667 password
+-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.
+ /CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass" #irssi efnet
- /CHANNEL ADD -auto #secret IRCnet password
-/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 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.
+ /WINDOW MOVE LEFT/RIGHT/number - move window elsewhere
- /WINDOW ITEM MOVE <number>|<name> - move channel/query to another window
-/WINDOW MOVE LEFT/RIGHT/number - move window elsewhere
+/WINDOW ITEM MOVE <number>|<name> - move channel/query to another window
+/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.
+ /SET use_status_window OFF
-/SET use_status_window OFF
+/WINDOW CLOSE it. /SET use_msgs_window ON
- /SET autocreate_query_level DCCMSGS (or if you don't want queries to
+
+/SET use_msgs_window ON
+/SET autocreate_query_level DCCMSGS (or if you don't want queries to
dcc chats either, say NONE)
-
+ /WINDOW NEW HIDE - create the window
- /WINDOW NAME (msgs) - name it to "(msgs)"
- /WINDOW LEVEL MSGS - make all private messages go to this window
- /WINDOW MOVE 1 - move it to first window
-/WINDOW NEW HIDE - create the window
+/WINDOW NAME (msgs) - name it to "(msgs)"
+/WINDOW LEVEL MSGS - make all private messages go to this window
+/WINDOW MOVE 1 - move it to first window
+/LAYOUT SAVE has been used.
+ /HELP levels
-/HELP levels
+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.
+ /CONNECT irc.server.org
-/CONNECT irc.server.org
+/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: -!- IRCNet: irc.song.fi:6667 (IRCNet)
+
+ -!- IRCNet: irc.song.fi:6667 (IRCNet)
-!- OFTC: irc.oftc.net:6667 (OFTC)
-!- RECON-1: 192.168.0.1:6667 () (02:59 left before reconnecting)
- /DISCONNECT network - disconnect server with tag "network"
- /DISCONNECT recon-1 - stop trying to reconnect to RECON-1 server
- /RMRECONNS - stop all server reconnections
+
+/DISCONNECT network - disconnect server with tag "network"
+/DISCONNECT recon-1 - stop trying to reconnect to RECON-1 server
+/RMRECONNS - stop all server reconnections
- /RECONNECT recon-1 - immediately try reconnecting back to RECON-1
- /RECONNECT ALL - immediately try reconnecting back to all
+/RECONNECT recon-1 - immediately try reconnecting back to RECON-1
+/RECONNECT ALL - immediately try reconnecting back to all
servers in reconnection queue
-
+ /WINDOW SERVER tag - set server "tag" active
- Ctrl-X - set the next server in list active
-/WINDOW SERVER tag - set server "tag" active
+Ctrl-X - set the next server in list active
+-servertag option to specify which server it should use:
+ /MSG -tag nick message
- /JOIN -tag #channel
- /QUERY -tag nick
-/MSG -tag nick message
+/JOIN -tag #channel
+/QUERY -tag nick
+/MSG tab completion also automatically adds the -tag option when nick isn’t in active server.
+ /WINDOW SERVER -sticky tag
-/WINDOW SERVER -sticky tag
+ /WINDOW NEW HIDE
- /WINDOW NAME (status)
- /WINDOW LEVEL ALL -MSGS
- /WINDOW SERVER -sticky network
+
+/WINDOW NEW HIDE
+/WINDOW NAME (msgs)
+/WINDOW LEVEL MSGS
+/WINDOW SERVER -sticky network
+/WINDOW NEW HIDE
+/WINDOW NAME (status)
+/WINDOW LEVEL ALL -MSGS
+/WINDOW SERVER -sticky network
- /WINDOW NEW HIDE
- /WINDOW NAME (msgs)
- /WINDOW LEVEL MSGS
- /WINDOW SERVER -sticky network
-7. /LASTLOG and jumping around in scrollback
/LASTLOG command can be used for searching texts in scrollback buffer. Simplest usages are
+ /LASTLOG word - print all lines with "word" in them
- /LASTLOG word 10 - print last 10 occurances of "word"
- /LASTLOG -topics - print all topic changes
-/LASTLOG word - print all lines with "word" in them
+/LASTLOG word 10 - print last 10 occurances of "word"
+/LASTLOG -topics - print all topic changes
+-force option. If you want to save the full lastlog to file, use
+ /LASTLOG -file ~/irc.log
-/LASTLOG -file ~/irc.log
+-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./AWAY reason). When you set yourself unaway (/AWAY), the new messages in away log are printed to screen. You can configure it with:
+ /SET awaylog_level MSGS HILIGHT - Specifies what messages to log
- /SET awaylog_file ~/.irssi/away.log - Specifies the file to use
-/SET awaylog_level MSGS HILIGHT - Specifies what messages to log
+/SET awaylog_file ~/.irssi/away.log - Specifies the file to use
+
+ /SET autolog ON
-/SET autolog ON
+/WHOIS requests, etc). You can specify the logging level yourself with
+ /SET autolog_level ALL -CRAP -CLIENTCRAP -CTCPS (this is the default)
-/SET autolog_level ALL -CRAP -CLIENTCRAP -CTCPS (this is the default)
+
+ /SET autolog_path ~/irclogs/$tag/$0.log (this is the default)
-/SET autolog_path ~/irclogs/$tag/$0.log (this is the default)
+
+ /SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log
-/SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log
+/HELP log/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: [cras@hurina] ~% cat
+
+ [cras@hurina] ~% cat
^[OP
-/BIND ^[OP /ECHO F1 pressed. If you use multiple terminals which have different bindings for the key, it would be better to use eg.:
+ /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.
+10. Proxies and IRC bouncers
/QUOTE SERVER commands manually. /SET use_proxy ON
- /SET proxy_address irc.bouncer.org
- /SET proxy_port 5000
+
+/SET proxy_password YOUR_BNC_PASSWORD_HERE
+/SET -clear proxy_string
+/SET proxy_string_after conn %s %d
+/SET use_proxy ON
+/SET proxy_address irc.bouncer.org
+/SET proxy_port 5000
- /SET proxy_password YOUR_BNC_PASSWORD_HERE
- /SET -clear proxy_string
- /SET proxy_string_after conn %s %d
-
+ /SERVER ADD -auto -network dalnet irc.dal.net
- /SERVER ADD -auto -network efnet irc.efnet.org
-/SERVER ADD -auto -network dalnet irc.dal.net
+/SERVER ADD -auto -network efnet irc.efnet.org
+/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.
+ /SET use_proxy ON
- /SET proxy_address <Proxy host address>
- /SET proxy_port <Proxy port>
-/SET use_proxy ON
+/SET proxy_address <Proxy host address>
+/SET proxy_port <Proxy port>
+
+ /SET -clear proxy_password
- /EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n
-/SET -clear proxy_password
+/EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n
+
+ /SET proxy_password your_pass
- /SET -clear proxy_string
- /SET proxy_string_after conn %s %d
-/SET proxy_password your_pass
+/SET -clear proxy_string
+/SET proxy_string_after conn %s %d
+ /SET -clear proxy_password
- /SET -clear proxy_string
+
+/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass
+/SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass
+/SET -clear proxy_password
+/SET -clear proxy_string
- /SERVER ADD -auto -network IRCnet fake.network 6667 ircpass
- /SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass
- /SET -clear proxy_password
- /SET -clear proxy_string
+
+/NETWORK ADD -user networkuser IRCnet
+/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass
+/NETWORK ADD -user oftcuser OFTC
+/SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass
+/SET -clear proxy_password
+/SET -clear proxy_string
- /NETWORK ADD -user networkuser IRCnet
- /SERVER ADD -auto -network IRCnet fake.network 6667 ircpass
- /NETWORK ADD -user oftcuser OFTC
- /SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass
-/NETWORK ADD command, and the 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.
+ /LOAD proxy
- /SET irssiproxy_password <password>
- /SET irssiproxy_ports <network>=<port> ... (eg. IRCnet=2777 efnet=2778)
-/LOAD proxy
+/SET irssiproxy_password <password>
+/SET irssiproxy_ports <network>=<port> ... (eg. IRCnet=2777 efnet=2778)
+/SERVER ADD and /NETWORK ADD. ..Except if you really don’t want to for some reason, and you only use one server connection, you may simply set:
-
- /SET irssiproxy_ports *=2777
-? allows the client to select the
-network dynamically on connect (see below):
-/SET irssiproxy_ports ?=2777
-
+/SET irssiproxy_ports *=2777
+/SET irssiproxy_password. For example:
-
- /SERVER ADD -network IRCnet my.irssi-proxy.org 2777 secret
- /SERVER ADD -network efnet my.irssi-proxy.org 2778 secret
-? in irssiproxy_ports:
-/SERVER ADD -network IRCnet my.irssi-proxy.org 2777 IRCnet:secret
-/SERVER ADD -network efnet my.irssi-proxy.org 2777 efnet:secret
-
-
-: from the actual proxy password./SERVER ADD -network IRCnet my.irssi-proxy.org 2777 secret
+/SERVER ADD -network efnet my.irssi-proxy.org 2778 secret
+\--with-socks 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./SET proxy settings don’t have anything to do with socks.
+ /SET proxy_password <password>
-/SET proxy_password <password>
+
+ /SET proxy_string CONNECT %s %d
- /SET proxy_string_after
-/SET proxy_string CONNECT %s %d
+/SET proxy_string_after
+11. Irssi’s settings
-: from the actual proxy password.
I don’t like automatic query windows, I don’t like status window, I do like msgs window where all messages go:
+ +/SET autocreate_own_query OFF
+/SET autocreate_query_level DCCMSGS
+/SET use_status_window OFF
+/SET use_msgs_window ON
+Disable automatic window closing when /PARTing channel or /UNQUERYing query:
/SET autoclose_windows OFF
+/SET reuse_unused_windows ON
+Here’s the settings that make irssi work exactly like ircII in window management (send me a note if you can think of more):
+ +/SET autocreate_own_query OFF
+/SET autocreate_query_level NONE
+/SET use_status_window OFF
+/SET use_msgs_window OFF
+/SET reuse_unused_windows ON
+/SET windows_auto_renumber OFF
+
+/SET autostick_split_windows OFF
+/SET autoclose_windows OFF
+/SET print_active_channel ON
+/STATUSBAR displays a list of statusbars:
/STATUSBAR displays a list of the current statusbars, along with their position and visibility:
Name Type Placement Position Visible
+ 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
-
+
-/STATUSBAR <name> prints the statusbar settings and it’s items. /STATUSBAR <name> ENABLE|DISABLE enables/disables the statusbar. /STATUSBAR <name> RESET resets the statusbar to it’s default settings, or if the statusbar was created by you, it will be removed.
+/STATUSBAR <name> prints the statusbar settings (type, placement, position, visibility) as well as its items. /STATUSBAR <name> ENABLE|DISABLE enables/disables the statusbar. /STATUSBAR <name> RESET resets the statusbar to its default settings, or if the statusbar was created by you, it will be removed.
-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 bottom. Position is a number, the higher the value the lower in screen 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:
+The statusbar type can be either window or root. If the type is window, then a statusbar will be created for each split window, otherwise it will be created only once. Placement can be top or bottom, which refers to the top or bottom of the screen. Position is a number, the higher the value the lower it will appear in-screen. 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. To adjust these settings, the following commands are available:
- /STATUSBAR <name> TYPE window|root
- /STATUSBAR <name> PLACEMENT top|bottom
- /STATUSBAR <name> POSITION <num>
- /STATUSBAR <name> VISIBLE always|active|inactive
-
+/STATUSBAR <name> TYPE window|root
+/STATUSBAR <name> PLACEMENT top|bottom
+/STATUSBAR <name> POSITION <num>
+/STATUSBAR <name> VISIBLE always|active|inactive
+
-When loading a new statusbar scripts, you’ll need to also specify where you want to show it. Statusbar items can be modified with:
+Statusbar items can also be added or removed via command. Note that when loading new statusbar scripts that add items, you will need to specify where you want to show the item and how it is aligned. This can be accomplished using the below commands:
- /STATUSBAR <name> ADD [-before | -after <item>] [-priority #] [-alignment left|right] <item>
- /STATUSBAR <name> REMOVE <item>
-
+/STATUSBAR <name> ADD [-before | -after <item>] [-priority #] [-alignment left|right] <item>
+/STATUSBAR <name> REMOVE <item>
+
-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: /STATUSBAR window ADD -before act mail.
+For statusbar scripts, the item name is usually equivalent to the script name. The documentation of the script ought to tell you if this is not the case. For example, to add mail.pl before the window activity item, use: /STATUSBAR window ADD -before act mail.
diff --git a/docs/startup-HOWTO.txt b/docs/startup-HOWTO.txt
new file mode 100644
index 00000000..5cc86af3
--- /dev/null
+++ b/docs/startup-HOWTO.txt
@@ -0,0 +1,796 @@
+Startup How-To
+
+To new Irssi users (not to new IRC users ..)
+
+Copyright (c) 2000-2002 by Timo Sirainen, release under [1]GNU FDL 1.1 license.
+
+Index with some FAQ questions that are answered in the chapter:
+
+ 1. First steps
+ 2. Basic user interface usage
+ □ Split windows work in weird way
+ □ How can I easily switch between windows?
+ □ But alt-1 etc. don’t work!
+ 3. Server and channel automation
+ □ How do I automatically connect to servers at startup?
+ □ How do I automatically join to channels at startup?
+ □ How do I automatically send commands to server at connect?
+ 4. Setting up windows and automatically restoring them at startup
+ 5. Status and msgs windows & message levels
+ □ I want /WHOIS to print reply to current window
+ □ I want all messages to go to one window, not create new windows
+ 6. How support for multiple servers works in irssi
+ □ I connected to some server that doesn’t respond and now irssi keeps
+ trying to reconnect to it again and again, how can I stop it??
+ □ I want to have own status and/or msgs window for each servers
+ 7. /LASTLOG and jumping around in scrollback
+ □ How can I save all texts in a window to file?
+ 8. Logging
+ 9. Changing keyboard bindings
+ □ How do I make F1 key do something?
+10. Proxies and IRC bouncers
+11. Irssi’s settings
+ □ For all the ircII people
+12. Statusbar
+ □ I loaded a statusbar script but it’s not visible anywhere!
+
+1. First steps
+
+IRC Networks are made of servers, and servers have channels. The default config
+has a few predefined networks, to list them:
+
+/NETWORK LIST
+
+And to connect to one of those networks and join a channel:
+
+/CONNECT liberachat
+/JOIN #irssi
+
+To add more networks:
+
+/NETWORK ADD ExampleNet
+
+Then add some servers (with -auto to automatically connect):
+
+/SERVER ADD -auto -network ExampleNet irc.example.net
+
+Automatically join to channels after connected to server:
+
+/CHANNEL ADD -auto #lounge ExampleNet
+
+To modify existing networks (or servers, or channels) just ADD again using the
+same name as before. This configures a network to identify with nickserv and
+wait for 2 seconds before joining channels:
+
+/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" ExampleNet
+
+If you have irssi 0.8.18 or higher and the irc network supports it, you can use
+SASL instead of nickserv, which is more reliable:
+
+/NETWORK ADD -sasl_username yourname -sasl_password yourpassword -sasl_mechanism PLAIN liberachat
+
+These commands have many more options, see their help for details:
+
+/HELP NETWORK
+/HELP SERVER
+/HELP CHANNEL
+/HELP
+
+If you want lines containing your nick to hilight:
+
+/HILIGHT nick
+
+Or, for irssi 0.8.18 or higher:
+
+/SET hilight_nick_matches_everywhere ON
+
+To get beeps on private messages or highlights:
+
+/SET beep_msg_level MSGS HILIGHT DCCMSGS
+
+No other irssi settings are needed (don’t enable bell_beeps), but there may be
+settings to change in your terminal multiplexer (screen/tmux), your terminal,
+or your desktop environment.
+
+2. Basic user interface usage
+
+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.
+
+By default, irssi uses “hidden windows” for everything. Hidden windows are
+created every time you /JOIN a channel or /QUERY someone. There’s several ways
+you can change between these windows:
+
+Meta-1, Meta-2, .. Meta-0 - Jump directly between windows 1-10
+Meta-q .. Meta-o - Jump directly between windows 11-19
+/WINDOW - Jump to any window with specified number
+Ctrl-P, Ctrl-N - Jump to previous / next window
+
+Clearly the easiest way is to use Meta-number keys. Meta usually means the ALT
+key, but if that doesn’t work, you can use ESC.
+
+Mac OS X users with ALT key issues might prefer using [2]iTerm2 instead of the
+default terminal emulator.
+
+Alt key as meta, for xterm/rxvt users
+
+If you use xterm or rxvt, you may need to set a few X resources:
+
+ XTerm*eightBitInput: false
+ XTerm*metaSendsEscape: true
+
+With rxvt, you can also specify which key acts as Meta key. So if you want to
+use ALT instead of Windows key for it, use:
+
+ rxvt*modifier: alt
+
+You could do this by changing the X key mappings:
+
+ xmodmap -e "keysym Alt_L = Meta_L Alt_L"
+
+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 and 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.
+
+Split windows and window items
+
+Note: [3]this guide might be a better introduction to window splits
+
+Irssi also supports split windows, they’ve had some problems in past but I
+think they should work pretty well now :) Here’s some commands related to them:
+
+/WINDOW NEW - Create new split window
+/WINDOW NEW HIDE - Create new hidden window
+/WINDOW CLOSE - Close split or hidden window
+
+/WINDOW HIDE [|] - Make the split window hidden window
+/WINDOW SHOW | - Make the hidden window a split window
+
+/WINDOW SHRINK [] - Shrink the split window
+/WINDOW GROW [] - Grow the split window
+/WINDOW BALANCE - Balance the sizes of all split windows
+
+By default, irssi uses “sticky windowing” for split windows. This means that
+windows created inside one split window cannot be moved to another split window
+without some effort. For example you could have following window layout:
+
+ Split window 1: win#1 - Status window, win#2 - Messages window
+ Split window 2: win#3 - IRCnet/#channel1, win#4 - IRCnet/#channel2
+ Split window 3: win#5 - efnet/#channel1, win#6 - efnet/#channel2
+
+When you are in win#1 and press ALT-6, irssi jumps to split window #3 and moves
+the efnet/#channel2 the active window.
+
+With non-sticky windowing the windows don’t have any relationship with split
+windows, pressing ALT-6 in win#1 moves win#6 to split window 1 and sets it
+active, except if win#6 was already visible in some other split window irssi
+just changes to that split window. This it the way windows work with ircii, if
+you prefer it you can set it with
+
+/SET autostick_split_windows OFF
+
+Each window can have multiple channels, queries and other “window items” inside
+them. If you don’t like windows at all, you disable automatic creating of them
+with
+
+/SET autocreate_windows OFF
+
+And if you keep all channels in one window, you most probably want the channel
+name printed in each line:
+
+/SET print_active_channel ON
+
+If you want to group only some channels or queries in one window, use
+
+/JOIN -window #channel
+/QUERY -window nick
+
+3. Server and channel automation
+
+Irssi’s multiple IRC network support is IMHO very good - at least compared to
+other clients :) Even if you’re only in one IRC network you should group all
+your servers to be in the same IRC network as this 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.
+
+First you need to have your IRC network set, use /NETWORK command to see if
+it’s already there. If it isn’t, use /NETWORK ADD yournetwork. If you want to
+execute some commands automatically when you’re connected to some network, use
+-autosendcmd option. Here’s some examples:
+
+/NETWORK ADD -autosendcmd '^msg bot invite' IRCnet
+/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" OFTC
+
+After that you need to add your servers. For example:
+
+/SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667
+/SERVER ADD -auto -network worknet irc.mycompany.com 6667 password
+
+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.
+
+And finally channels:
+
+/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
+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.
+
+4. Setting up windows and automatically restoring them at startup
+
+First connect to all the servers, join the channels and create the queries you
+want. If you want to move the windows or channels around use commands:
+
+/WINDOW MOVE LEFT/RIGHT/number - move window elsewhere
+/WINDOW ITEM MOVE | - move channel/query to another window
+
+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.
+
+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.
+
+5. Status and msgs windows & message levels
+
+By default, all the “extra messages” go to status window. This means pretty
+much all messages that don’t clearly belong to some channel or query. Some
+people like it, some don’t. If you want to remove it, use
+
+/SET use_status_window OFF
+
+This doesn’t have any effect until you restart irssi. If you want to remove it
+immediately, just /WINDOW CLOSE it.
+
+Another common window is “messages window”, where all private messages go. By
+default it’s disabled and query windows are created instead. To make all
+private messages go to msgs window, say:
+
+/SET use_msgs_window ON
+/SET autocreate_query_level DCCMSGS (or if you don't want queries to
+ dcc chats either, say NONE)
+
+use_msgs_window either doesn’t have any effect until restarting irssi. To
+create it immediately say:
+
+/WINDOW NEW HIDE - create the window
+/WINDOW NAME (msgs) - name it to "(msgs)"
+/WINDOW LEVEL MSGS - make all private messages go to this window
+/WINDOW MOVE 1 - move it to first window
+
+Note that neither use_msgs_window nor use_status_window have any effect at all
+if /LAYOUT SAVE has been used.
+
+This brings us to message levels.. What are they? All messages that irssi
+prints have one or more “message levels”. Most common are PUBLIC for public
+messages in channels, MSGS for private messages and CRAP for all sorts of
+messages with no real classification. You can get a whole list of levels with
+
+/HELP levels
+
+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.
+
+6. How support for multiple servers works in irssi
+
+ircii and several other clients support multiple servers by placing the
+connection into some window. IRSSI DOES NOT. There is no required relationship
+between window and server. You can connect to 10 servers and manage them all in
+just one window, or join channel in each one of them to one single window if
+you really want to. That being said, here’s how you do connect to new server
+without closing the old connection:
+
+/CONNECT irc.server.org
+
+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:
+
+ -!- IRCNet: irc.song.fi:6667 (IRCNet)
+ -!- OFTC: irc.oftc.net:6667 (OFTC)
+ -!- RECON-1: 192.168.0.1:6667 () (02:59 left before reconnecting)
+
+Here you see that we’re connected to IRCNet and OFTC networks. The IRCNet at
+the beginning is called the “server tag” while the (IRCnet) at the end shows
+the IRC network. Server tag specifies unique tag to refer to the server,
+usually it’s the same as the IRC network. When the IRC network isn’t known it’s
+some part of the server name. When there’s multiple connections to same IRC
+network or server, irssi adds a number after the tag so there could be network,
+network2, network3 etc.
+
+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.
+
+To disconnect one of the servers, or to stop irssi from reconnecting, use
+
+/DISCONNECT network - disconnect server with tag "network"
+/DISCONNECT recon-1 - stop trying to reconnect to RECON-1 server
+/RMRECONNS - stop all server reconnections
+
+/RECONNECT recon-1 - immediately try reconnecting back to RECON-1
+/RECONNECT ALL - immediately try reconnecting back to all
+ servers in reconnection queue
+
+Now that you’re connected to all your servers, you’ll have to know how to
+specify which one of them you want to use. One way is to have an empty window,
+like status or msgs window. In it, you can specify which server to set active
+with
+
+/WINDOW SERVER tag - set server "tag" active
+Ctrl-X - set the next server in list active
+
+When the server is active, you can use it normally. When there’s multiple
+connected servers, irssi adds [servertag] prefix to all messages in non-channel
+/query messages so you’ll know where it came from.
+
+Several commands also accept -servertag option to specify which server it
+should use:
+
+/MSG -tag nick message
+/JOIN -tag #channel
+/QUERY -tag nick
+
+/MSG tab completion also automatically adds the -tag option when nick isn’t in
+active server.
+
+Window’s server can be made sticky. When sticky, it will never automatically
+change to anything else, and if server gets disconnected, the window won’t have
+any active server. When the server gets connected again, it is automatically
+set active in the window. To set the window’s server sticky use
+
+/WINDOW SERVER -sticky tag
+
+This is useful if you wish to have multiple status or msgs windows, one for
+each server. Here’s how to do them (repeat for each server)
+
+/WINDOW NEW HIDE
+/WINDOW NAME (status)
+/WINDOW LEVEL ALL -MSGS
+/WINDOW SERVER -sticky network
+
+/WINDOW NEW HIDE
+/WINDOW NAME (msgs)
+/WINDOW LEVEL MSGS
+/WINDOW SERVER -sticky network
+
+7. /LASTLOG and jumping around in scrollback
+
+/LASTLOG command can be used for searching texts in scrollback buffer. Simplest
+usages are
+
+/LASTLOG word - print all lines with "word" in them
+/LASTLOG word 10 - print last 10 occurances of "word"
+/LASTLOG -topics - print all topic changes
+
+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
+
+/LASTLOG -file ~/irc.log
+
+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.
+
+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.
+
+8. Logging
+
+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:
+
+/SET awaylog_level MSGS HILIGHT - Specifies what messages to log
+/SET awaylog_file ~/.irssi/away.log - Specifies the file to use
+
+Easiest way to start logging with Irssi is to use autologging. With it Irssi
+logs all channels and private messages to specified directory. You can turn it
+on with
+
+/SET autolog ON
+
+By default it logs pretty much everything execept CTCPS or CRAP (/WHOIS
+requests, etc). You can specify the logging level yourself with
+
+/SET autolog_level ALL -CRAP -CLIENTCRAP -CTCPS (this is the default)
+
+By default irssi logs to ~/irclogs//.log. You can change
+this with
+
+/SET autolog_path ~/irclogs/$tag/$0.log (this is the default)
+
+The path is automatically created if it doesn’t exist. $0 specifies the target
+(channel/nick). You can make irssi automatically rotate the logs by adding date
+/time formats to the file name. The formats are in “man strftime” format. For
+example
+
+/SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log
+
+For logging only some specific channels or nicks, see /HELP log
+
+9. Changing keyboard bindings
+
+You can change any keyboard binding that terminal lets irssi know about. It
+doesn’t let irssi know everything, so for example shift-backspace can’t be
+bound unless you modify xterm resources somehow.
+
+/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:
+
+ [cras@hurina] ~% cat
+ ^[OP
+
+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.:
+
+/BIND ^[OP key F1
+/BIND ^[11~ key F1
+/BIND F1 /ECHO F1 pressed.
+
+10. Proxies and IRC bouncers
+
+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.
+
+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 to servers
+irc.dal.net and irc.efnet.org. First you’d need to setup the bouncer:
+
+/SET use_proxy ON
+/SET proxy_address irc.bouncer.org
+/SET proxy_port 5000
+
+/SET proxy_password YOUR_BNC_PASSWORD_HERE
+/SET -clear proxy_string
+/SET proxy_string_after conn %s %d
+
+Then you’ll need to add the server connections. These are done exactly as if
+you’d want to connect directly to them. Nothing special about them:
+
+/SERVER ADD -auto -network dalnet irc.dal.net
+/SERVER ADD -auto -network efnet irc.efnet.org
+
+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.
+
+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.
+
+Proxy specific settings:
+
+All proxies except irssi proxy and socks proxy have these settings in common:
+
+/SET use_proxy ON
+/SET proxy_address
+/SET proxy_port
+
+HTTP proxy
+
+Use these settings with HTTP proxies:
+
+/SET -clear proxy_password
+/EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n
+
+BNC
+
+/SET proxy_password your_pass
+/SET -clear proxy_string
+/SET proxy_string_after conn %s %d
+
+dircproxy
+
+dircproxy separates the server connections by passwords. So, if you for example
+have network connection with password ircpass and OFTC connection with
+oftcpass, you would do something like this:
+
+/SET -clear proxy_password
+/SET -clear proxy_string
+
+/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass
+/SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass
+
+The server name and port you give isn’t used anywhere, so you can put anything
+you want in there.
+
+psyBNC
+
+psyBNC has internal support for multiple servers. However, it could be a bit
+annoying to use, and some people just use different users for connecting to
+different servers. You can manage this in a bit same way as with dircproxy, by
+creating fake connections:
+
+/SET -clear proxy_password
+/SET -clear proxy_string
+
+/NETWORK ADD -user networkuser IRCnet
+/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass
+/NETWORK ADD -user oftcuser OFTC
+/SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass
+
+So, you’ll specify the usernames with /NETWORK ADD command, and the user’s
+password with /SERVER ADD.
+
+Irssi proxy
+
+Irssi contains it’s own proxy which you can build giving \--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 a new client connects to it, but irssi proxy
+shares your existing IRC connection(s) to multiple clients. And even more
+clearly: You can use only one IRC server connection of the irssi proxy to IRC
+with as many clients as you want. 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? :)
+
+Irssi proxy supports sharing multiple server connections in different ports,
+like you can share network in port 2777 and efnet in port 2778.
+
+Usage in proxy side:
+
+/LOAD proxy
+/SET irssiproxy_password
+/SET irssiproxy_ports = ... (eg. IRCnet=2777 efnet=2778)
+
+NOTE: you MUST add all the servers you are using to server and network lists
+with /SERVER ADD and /NETWORK ADD. ..Except if you really don’t want to for
+some reason, and you only use one server connection, you may simply set:
+
+/SET irssiproxy_ports *=2777
+
+Usage in client side:
+
+Just connect to the irssi proxy like it is a normal server with password
+specified in /SET irssiproxy_password. For example:
+
+/SERVER ADD -network IRCnet my.irssi-proxy.org 2777 secret
+/SERVER ADD -network efnet my.irssi-proxy.org 2778 secret
+
+Irssi proxy works fine with other IRC clients as well.
+
+SOCKS
+
+Using [4]proxychains-ng is recommended for using irssi with a socks proxy.
+
+Irssi does not support socks proxy natively.
+
+Note that /SET proxy settings don’t have anything to do with socks.
+
+Others
+
+IRC bouncers usually work like IRC servers, and want a password. You can give
+it with:
+
+/SET proxy_password
+
+Irssi’s defaults for connect strings are
+
+/SET proxy_string CONNECT %s %d
+/SET proxy_string_after
+
+The proxy_string is sent before NICK/USER commands, the proxy_string_after is
+sent after them. %s and %d can be used with both of them.
+
+11. Irssi’s settings
+
+Here’s some settings you might want to change (the default value is shown):
+Also check the [5]Settings Documentation
+
+Queries
+
+/SET autocreate_own_query ON
+ Should new query window be created when you send message to someone (with /
+ MSG).
+/SET autocreate_query_level MSGS
+ 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 autocreate_query_level.
+/SET autoclose_query 0
+ Query windows can be automatically closed after certain time of inactivity.
+ Queries with unread messages aren’t closed and active window is neither
+ never closed. The value is given in seconds.
+
+Windows
+
+/SET use_msgs_window OFF
+ Create messages window at startup. All private messages go to this window.
+ This only makes sense if you’ve disabled automatic query windows. Message
+ window can also be created manually with /WINDOW LEVEL MSGS, /WINDOW NAME
+ (msgs).
+/SET use_status_window ON
+ 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).
+/SET autocreate_windows ON
+ Should we create new windows for new window items or just place everything
+ in one window
+/SET autoclose_windows ON
+ Should window be automatically closed when the last item in them is removed
+ (ie. /PART, /UNQUERY).
+/SET reuse_unused_windows OFF
+ When finding where to place new window item (channel, query) Irssi first
+ tries to use already existing empty windows. If this is set ON, new window
+ will always be created for all window items. This setting is ignored if
+ autoclose_windows is set ON.
+/SET window_auto_change OFF
+ 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.
+/SET print_active_channel OFF
+ When you keep more than one channel in same window, Irssi prints the
+ messages coming to active channel as text and other channels as
+ text. If this setting is set ON, the messages to active
+ channels are also printed in the latter way.
+/SET window_history OFF
+ Should command history be kept separate for each window.
+
+User information
+
+/SET nick
+ Your nick name
+/SET alternate_nick
+ Your alternate nick.
+/SET user_name
+ Your username, if you have ident enabled this doesn’t affect anything
+/SET real_name
+ Your real name.
+
+Server information
+
+/SET skip_motd OFF
+ Should we hide server’s MOTD (Message Of The Day).
+/SET server_reconnect_time 300
+ Seconds to wait before connecting to same server again. Don’t set this too
+ low since it usually doesn’t help at all - if the host is down, the few
+ extra minutes of waiting won’t hurt much.
+/SET lag_max_before_disconnect 300
+ Maximum server lag in seconds before disconnecting and trying to reconnect.
+ This happens mostly only when network breaks between you and IRC server.
+
+Appearance
+
+/SET timestamps ON
+ Show timestamps before each message.
+/SET hide_text_style OFF
+ Hide all bolds, underlines, MIRC colors, etc.
+/SET show_nickmode ON
+ Show the nick’s mode before nick in channels, ie. ops have <@nick>, voices
+ <+nick> and others < nick>
+/SET show_nickmode_empty ON
+ If the nick doesn’t have a mode, use one space. ie. ON: < nick>, OFF:
+
+/SET show_quit_once OFF
+ Show quit message only once in some of the channel windows the nick was in
+ instead of in all windows.
+/SET lag_min_show 100
+ Show the server lag in status bar if it’s bigger than this, the unit is 1/
+ 100 of seconds (ie. the default value of 100 = 1 second).
+/SET indent 10
+ 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.
+/SET activity_hide_targets
+ 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.
+
+Nick completion
+
+/SET completion_auto OFF
+ Automatically complete the nick if line begins with start of nick and the
+ completion character. Learn to use the tab-completion instead, it’s a lot
+ better ;)
+/SET completion_char :
+ Completion character to use.
+
+For all the ircII people
+
+I don’t like automatic query windows, I don’t like status window, I do like
+msgs window where all messages go:
+
+/SET autocreate_own_query OFF
+/SET autocreate_query_level DCCMSGS
+/SET use_status_window OFF
+/SET use_msgs_window ON
+
+Disable automatic window closing when /PARTing channel or /UNQUERYing query:
+
+/SET autoclose_windows OFF
+/SET reuse_unused_windows ON
+
+Here’s the settings that make irssi work exactly like ircII in window
+management (send me a note if you can think of more):
+
+/SET autocreate_own_query OFF
+/SET autocreate_query_level NONE
+/SET use_status_window OFF
+/SET use_msgs_window OFF
+/SET reuse_unused_windows ON
+/SET windows_auto_renumber OFF
+
+/SET autostick_split_windows OFF
+/SET autoclose_windows OFF
+/SET print_active_channel ON
+
+12. Statusbar
+
+/STATUSBAR displays a list of the current statusbars, along with their position
+and visibility:
+
+ 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
+
+/STATUSBAR prints the statusbar settings (type, placement, position,
+visibility) as well as its items. /STATUSBAR ENABLE|DISABLE enables/
+disables the statusbar. /STATUSBAR RESET resets the statusbar to its
+default settings, or if the statusbar was created by you, it will be removed.
+
+The statusbar type can be either window or root. If the type is window, then a
+statusbar will be created for each split window, otherwise it will be created
+only once. Placement can be top or bottom, which refers to the top or bottom of
+the screen. Position is a number, the higher the value the lower it will appear
+in-screen. 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.
+To adjust these settings, the following commands are available:
+
+/STATUSBAR TYPE window|root
+/STATUSBAR PLACEMENT top|bottom
+/STATUSBAR POSITION
+/STATUSBAR VISIBLE always|active|inactive
+
+Statusbar items can also be added or removed via command. Note that when
+loading new statusbar scripts that add items, you will need to specify where
+you want to show the item and how it is aligned. This can be accomplished using
+the below commands:
+
+/STATUSBAR ADD [-before | -after - ] [-priority #] [-alignment left|right]
-
+/STATUSBAR
REMOVE -
+
+For statusbar scripts, the item name is usually equivalent to the script name.
+The documentation of the script ought to tell you if this is not the case. For
+example, to add mail.pl before the window activity item, use: /STATUSBAR window
+ADD -before act mail.
+
+
+References:
+
+[1] https://www.gnu.org/licenses/fdl.html
+[2] https://www.iterm2.com/
+[3] https://quadpoint.org/articles/irssisplit/
+[4] https://github.com/rofl0r/proxychains-ng
+[5] https://irssi.org/documentation/settings/
diff --git a/file2header.sh b/file2header.sh
deleted file mode 100755
index f25ae13b..00000000
--- a/file2header.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-echo "const char *$2 ="
-cat $1|sed 's/\\/\\\\/g'|sed 's/"/\\"/g'|sed 's/^/\"/'|sed 's/$/\\n\"/'
-echo ";"
diff --git a/fuzz-support/fuzz.diff b/fuzz-support/fuzz.diff
new file mode 100644
index 00000000..5a3f2176
--- /dev/null
+++ b/fuzz-support/fuzz.diff
@@ -0,0 +1,269 @@
+diff --git a/src/core/network.c b/src/core/network.c
+index 3e1b7c7..1e5324a 100644
+--- a/src/core/network.c
++++ b/src/core/network.c
+@@ -199,6 +199,10 @@ GIOChannel *net_connect_ip(IPADDR *ip, int port, IPADDR *my_ip)
+ /* Connect to named UNIX socket */
+ GIOChannel *net_connect_unix(const char *path)
+ {
++ if (strcmp(path, "/dev/stdin") == 0) {
++ return g_io_channel_new(0);
++ }
++
+ struct sockaddr_un sa;
+ int handle, ret;
+
+@@ -336,6 +340,8 @@ int net_receive(GIOChannel *handle, char *buf, int len)
+ /* Transmit data, return number of bytes sent, -1 = error */
+ int net_transmit(GIOChannel *handle, const char *data, int len)
+ {
++ return write(1, data, len);
++
+ gsize ret;
+ GIOStatus status;
+ GError *err = NULL;
+@@ -495,6 +501,7 @@ int net_host2ip(const char *host, IPADDR *ip)
+ /* Get socket error */
+ int net_geterror(GIOChannel *handle)
+ {
++ return 0;
+ int data;
+ socklen_t len = sizeof(data);
+
+diff --git a/src/core/servers-reconnect.c b/src/core/servers-reconnect.c
+index 58c9dd0..0c6ec1b 100644
+--- a/src/core/servers-reconnect.c
++++ b/src/core/servers-reconnect.c
+@@ -484,7 +484,8 @@ void servers_reconnect_init(void)
+ reconnects = NULL;
+ last_reconnect_tag = 0;
+
+- reconnect_timeout_tag = g_timeout_add(1000, (GSourceFunc) server_reconnect_timeout, NULL);
++ (void) server_reconnect_timeout;
++
+ read_settings();
+
+ signal_add("server connect failed", (SIGNAL_FUNC) sig_reconnect);
+diff --git a/src/core/settings.c b/src/core/settings.c
+index e65ceb2..f9dc678 100644
+--- a/src/core/settings.c
++++ b/src/core/settings.c
+@@ -704,7 +704,10 @@ int irssi_config_is_changed(const char *fname)
+
+ static CONFIG_REC *parse_configfile(const char *fname)
+ {
+- CONFIG_REC *config;
++ CONFIG_REC *config = config_open(NULL, -1);
++ config_parse_data(config, default_config, "internal");
++ return config;
++
+ struct stat statbuf;
+ const char *path;
+ char *str;
+@@ -871,8 +874,6 @@ void settings_init(void)
+ init_configfile();
+
+ settings_add_bool("misc", "settings_autosave", TRUE);
+- timeout_tag = g_timeout_add(SETTINGS_AUTOSAVE_TIMEOUT,
+- (GSourceFunc) sig_autosave, NULL);
+ signal_add("irssi init finished", (SIGNAL_FUNC) sig_init_finished);
+ signal_add("gui exit", (SIGNAL_FUNC) sig_autosave);
+ }
+diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c
+index 1b2ab1e..4344cd9 100644
+--- a/src/fe-common/core/fe-common-core.c
++++ b/src/fe-common/core/fe-common-core.c
+@@ -320,6 +320,8 @@ static void autoconnect_servers(void)
+ GSList *tmp, *chatnets;
+ char *str;
+
++ return;
++
+ if (autocon_server != NULL) {
+ /* connect to specified server */
+ if (autocon_password == NULL)
+@@ -390,6 +392,7 @@ static void sig_setup_changed(void)
+
+ static void autorun_startup(void)
+ {
++ return;
+ char *path;
+ GIOChannel *handle;
+ GString *buf;
+diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c
+index 2b1459b..2e518a1 100644
+--- a/src/fe-common/core/themes.c
++++ b/src/fe-common/core/themes.c
+@@ -790,9 +790,8 @@ static void theme_read_module(THEME_REC *theme, const char *module)
+ {
+ CONFIG_REC *config;
+
+- config = config_open(theme->path, -1);
+- if (config != NULL)
+- config_parse(config);
++ config = config_open(NULL, -1);
++ config_parse_data(config, default_theme, "internal");
+
+ theme_init_module(theme, module, config);
+
+@@ -987,7 +986,7 @@ static int theme_read(THEME_REC *theme, const char *path)
+ THEME_READ_REC rec;
+ char *str;
+
+- config = config_open(path, -1) ;
++ config = config_open(NULL, -1) ;
+ if (config == NULL) {
+ /* didn't exist or no access? */
+ str = g_strdup_printf("Error reading theme file %s: %s",
+@@ -997,7 +996,7 @@ static int theme_read(THEME_REC *theme, const char *path)
+ return FALSE;
+ }
+
+- if (path == NULL)
++ if (1)
+ config_parse_data(config, default_theme, "internal");
+ else
+ config_parse(config);
+@@ -1200,6 +1199,7 @@ static void module_save(const char *module, MODULE_THEME_REC *rec,
+
+ static void theme_save(THEME_REC *theme, int save_all)
+ {
++ return;
+ CONFIG_REC *config;
+ THEME_SAVE_REC data;
+ char *path;
+diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c
+index 7c71edd..6bf2177 100644
+--- a/src/fe-text/gui-readline.c
++++ b/src/fe-text/gui-readline.c
+@@ -1126,7 +1126,6 @@ void gui_readline_init(void)
+ paste_timeout_id = -1;
+ paste_bracketed_mode = FALSE;
+ g_get_current_time(&last_keypress);
+- input_listen_init(STDIN_FILENO);
+
+ settings_add_bool("lookandfeel", "term_appkey_mode", TRUE);
+ settings_add_str("history", "scroll_page_count", "/2");
+diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c
+index ad79e0c..84d0c5c 100644
+--- a/src/fe-text/irssi.c
++++ b/src/fe-text/irssi.c
+@@ -314,20 +314,16 @@ int main(int argc, char **argv)
+ textui_finish_init();
+ main_loop = g_main_loop_new(NULL, TRUE);
+
++#ifdef __AFL_HAVE_MANUAL_CONTROL
++ __AFL_INIT();
++#endif
++
++ signal_emit("command connect", 1, "/dev/stdin 6667");
++
+ /* Does the same as g_main_run(main_loop), except we
+ can call our dirty-checker after each iteration */
+ while (!quitting) {
+- term_refresh_freeze();
+ g_main_context_iteration(NULL, TRUE);
+- term_refresh_thaw();
+-
+- if (reload_config) {
+- /* SIGHUP received, do /RELOAD */
+- reload_config = FALSE;
+- signal_emit("command reload", 1, "");
+- }
+-
+- dirty_check();
+ }
+
+ g_main_loop_unref(main_loop);
+diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c
+index b2478c6..cebe260 100644
+--- a/src/fe-text/term-terminfo.c
++++ b/src/fe-text/term-terminfo.c
+@@ -29,6 +29,10 @@
+ #include
+ #include
+
++#undef putc
++#define putc(x, y) (void) (x)
++#define fputc(x, y) (void) (x), 0
++
+ /* returns number of characters in the beginning of the buffer being a
+ a single character, or -1 if more input is needed. The character will be
+ saved in result */
+@@ -113,7 +117,8 @@ int term_init(void)
+ vcmove = FALSE; cforcemove = TRUE;
+ curs_visible = TRUE;
+
+- current_term = terminfo_core_init(stdin, stdout);
++ FILE *devnull = fopen("/dev/null", "r+");
++ current_term = terminfo_core_init(devnull, devnull);
+ if (current_term == NULL)
+ return FALSE;
+
+@@ -670,6 +675,7 @@ void term_set_input_type(int type)
+
+ void term_gets(GArray *buffer, int *line_count)
+ {
++ return;
+ int ret, i, char_len;
+
+ /* fread() doesn't work */
+diff --git a/src/fe-text/terminfo-core.c b/src/fe-text/terminfo-core.c
+index 9c9179a..6349935 100644
+--- a/src/fe-text/terminfo-core.c
++++ b/src/fe-text/terminfo-core.c
+@@ -6,6 +6,10 @@
+ # define _POSIX_VDISABLE 0
+ #endif
+
++#undef putc
++#define putc(x, y) (void) (x)
++#define fputc(x, y) (void) (x), 0
++
+ #define tput(s) tputs(s, 0, term_putchar)
+ inline static int term_putchar(int c)
+ {
+diff --git a/src/irc/core/irc.c b/src/irc/core/irc.c
+index 4dce3fc..25fbb34 100644
+--- a/src/irc/core/irc.c
++++ b/src/irc/core/irc.c
+@@ -383,12 +383,13 @@ static void irc_parse_incoming(SERVER_REC *server)
+ signal_emit_id(signal_server_incoming, 2, server, str);
+
+ if (server->connection_lost)
+- server_disconnect(server);
++ exit(0);
+
+ count++;
+ }
+ if (ret == -1) {
+ /* connection lost */
++ exit(0);
+ server->connection_lost = TRUE;
+ server_disconnect(server);
+ }
+diff --git a/src/lib-config/write.c b/src/lib-config/write.c
+index 37e51f0..ee82726 100644
+--- a/src/lib-config/write.c
++++ b/src/lib-config/write.c
+@@ -299,6 +299,8 @@ static int config_write_block(CONFIG_REC *rec, CONFIG_NODE *node, int list, int
+
+ int config_write(CONFIG_REC *rec, const char *fname, int create_mode)
+ {
++ return 0;
++
+ int ret;
+ int fd;
+
+diff --git a/src/perl/perl-core.c b/src/perl/perl-core.c
+index 2c61df7..485fe25 100644
+--- a/src/perl/perl-core.c
++++ b/src/perl/perl-core.c
+@@ -395,6 +395,7 @@ int perl_get_api_version(void)
+
+ void perl_scripts_autorun(void)
+ {
++ return;
+ DIR *dirp;
+ struct dirent *dp;
+ struct stat statbuf;
diff --git a/irssi-config.in b/irssi-config.in
deleted file mode 100644
index cd529ed0..00000000
--- a/irssi-config.in
+++ /dev/null
@@ -1,9 +0,0 @@
-PROG_LIBS="@PROG_LIBS@"
-COMMON_LIBS="@COMMON_LIBS@"
-
-PERL_LINK_LIBS="@PERL_LINK_LIBS@"
-PERL_FE_LINK_LIBS="@PERL_FE_LINK_LIBS@"
-PERL_LINK_FLAGS="@PERL_LINK_FLAGS@"
-
-CHAT_MODULES="@CHAT_MODULES@"
-irc_MODULES="@irc_MODULES@"
diff --git a/irssi-version.sh b/irssi-version.sh
deleted file mode 100755
index 1fc6a558..00000000
--- a/irssi-version.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-DATE=`GIT_DIR=$1/.git git log -1 --pretty=format:%ai HEAD`
-
-VERSION_DATE=`echo $DATE | cut -f 1 -d ' ' | tr -d -`
-VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F: '{printf "%d", $1$2}'`
-
-if test -z "$VERSION_DATE"; then
- exec>&2
- echo "**Error**: `basename "$0"` must be run in a git clone, cannot proceed."
- exit 1
-fi
-
-echo "#define IRSSI_VERSION_DATE $VERSION_DATE"
-echo "#define IRSSI_VERSION_TIME $VERSION_TIME"
-
-if echo "${VERSION}" | grep -q -- -head; then
- # -head version, get extra details from git if we can
- git_version=$(GIT_DIR=$1/.git git describe --dirty --long --always --tags)
- if [ $? = 0 ]; then
- new_version="$(echo "${VERSION}" | sed 's/-head//')"
- # Because the git tag won't yet include the next release we modify the git
- # describe output using the version defined from configure.ac.
- version="${new_version}-$(echo "${git_version}" | sed 's/^.*-[0-9]\+-//')"
- echo "#undef PACKAGE_VERSION"
- echo "#define PACKAGE_VERSION \"${version}\""
- fi
-fi
diff --git a/irssi.conf b/irssi.conf
index 0e486807..010520fd 100644
--- a/irssi.conf
+++ b/irssi.conf
@@ -1,10 +1,10 @@
servers = (
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
- { address = "ssl.efnet.org"; chatnet = "EFNet"; port = "9999"; use_tls = "yes"; },
+ { address = "ssl.efnet.org"; chatnet = "EFNet"; port = "9999"; use_tls = "yes"; tls_verify = "no"; },
{ address = "irc.esper.net"; chatnet = "EsperNet"; port = "6697"; use_tls = "yes"; tls_verify = "yes"; },
- { address = "chat.freenode.net"; chatnet = "Freenode"; port = "6697"; use_tls = "yes"; tls_verify = "yes"; },
+ { address = "irc.libera.chat"; chatnet = "liberachat";port = "6697"; use_tls = "yes"; tls_verify = "yes"; },
{ address = "irc.gamesurge.net"; chatnet = "GameSurge"; port = "6667"; },
- { address = "eu.irc6.net"; chatnet = "IRCnet"; port = "6667"; use_tls = "yes"; },
+ { address = "ssl.ircnet.ovh"; chatnet = "IRCnet"; port = "6697"; use_tls = "yes"; tls_verify = "yes"; },
{ address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; },
{ address = "irc.ircsource.net"; chatnet = "IRCSource"; port = "6667"; },
{ address = "irc.netfuze.net"; chatnet = "NetFuze"; port = "6667"; },
@@ -34,7 +34,7 @@ chatnets = {
max_msgs = "4";
max_whois = "1";
};
- Freenode = {
+ liberachat = {
type = "IRC";
max_kicks = "1";
max_msgs = "4";
@@ -95,8 +95,8 @@ chatnets = {
channels = (
{ name = "#lobby"; chatnet = "EsperNet"; autojoin = "No"; },
- { name = "#freenode"; chatnet = "Freenode"; autojoin = "No"; },
- { name = "#irssi"; chatnet = "Freenode"; autojoin = "No"; },
+ { name = "#libera"; chatnet = "liberachat";autojoin = "No"; },
+ { name = "#irssi"; chatnet = "liberachat";autojoin = "No"; },
{ name = "#gamesurge"; chatnet = "GameSurge"; autojoin = "No"; },
{ name = "#irssi"; chatnet = "IRCNet"; autojoin = "No"; },
{ name = "#ircsource"; chatnet = "IRCSource"; autojoin = "No"; },
@@ -107,7 +107,7 @@ channels = (
aliases = {
ATAG = "WINDOW SERVER";
- ADDALLCHANS = "SCRIPT EXEC foreach my \\$channel (Irssi::channels()) { Irssi::command(\"CHANNEL ADD -auto \\$channel->{name} \\$channel->{server}->{tag} \\$channel->{key}\")\\;}";
+ ADDALLCHANS = "SCRIPT EXEC foreach my \\$channel (Irssi::channels()) { Irssi::command(\"CHANNEL ADD -auto \\$channel->{visible_name} \\$channel->{server}->{tag} \\$channel->{key}\")\\;}";
B = "BAN";
BACK = "AWAY";
BANS = "BAN";
@@ -115,7 +115,7 @@ aliases = {
C = "CLEAR";
CALC = "EXEC - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi";
CHAT = "DCC CHAT";
- CUBES = "SCRIPT EXEC Irssi::active_win->print(\"%_bases\", MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print( do { join '', map { \"%x0\\${_}0\\$_\" } '0'..'9','A'..'F' }, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print(\"%_cubes\", MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print( do { my \\$y = \\$_*6 \\; join '', map { my \\$x = \\$_ \\; map { \"%x\\$x\\$_\\$x\\$_\" } @{['0'..'9','A'..'Z']}[\\$y .. \\$y+5] } 1..6 }, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) for 0..5 \\; Irssi::active_win->print(\"%_grays\", MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print( do { join '', map { \"%x7\\${_}7\\$_\" } 'A'..'X' }, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) \\; Irssi::active_win->print(\"%_mIRC extended colours\", MSGLEVEL_CLIENTCRAP) \\; my \\$x \\; \\$x .= sprintf \"\00399,%02d%02d\",\\$_,\\$_ for 0..15 \\; Irssi::active_win->print(\\$x, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) \\; for my \\$z (0..6) { my \\$x \\; \\$x .= sprintf \"\00399,%02d%02d\",\\$_,\\$_ for 16+(\\$z*12)..16+(\\$z*12)+11 \\; Irssi::active_win->print(\\$x, MSGLEVEL_NEVER | MSGLEVEL_CLIENTCRAP) }";
+ CS = "QUOTE CS";
DATE = "TIME";
DEHIGHLIGHT = "DEHILIGHT";
DESCRIBE = "ACTION";
@@ -134,9 +134,12 @@ aliases = {
LAST = "LASTLOG";
LEAVE = "PART";
M = "MSG";
+ MS = "QUOTE MS";
MUB = "UNBAN *";
N = "NAMES";
NMSG = "^MSG";
+ NS = "QUOTE NS";
+ OS = "QUOTE OS";
P = "PART";
Q = "QUERY";
RESET = "SET -default";
@@ -144,8 +147,9 @@ aliases = {
SAY = "MSG *";
SB = "SCROLLBACK";
SBAR = "STATUSBAR";
+ SHELP = "QUOTE HELP";
SIGNOFF = "QUIT";
- SV = "MSG * Irssi $J ($V) - http://www.irssi.org";
+ SV = "MSG * Irssi $J ($V) - https://irssi.org";
T = "TOPIC";
UB = "UNBAN";
UMODE = "MODE $N";
@@ -160,105 +164,6 @@ aliases = {
WN = "WINDOW NEW HIDDEN";
WQUERY = "QUERY -window";
WW = "WHOWAS";
- 1 = "WINDOW GOTO 1";
- 2 = "WINDOW GOTO 2";
- 3 = "WINDOW GOTO 3";
- 4 = "WINDOW GOTO 4";
- 5 = "WINDOW GOTO 5";
- 6 = "WINDOW GOTO 6";
- 7 = "WINDOW GOTO 7";
- 8 = "WINDOW GOTO 8";
- 9 = "WINDOW GOTO 9";
- 10 = "WINDOW GOTO 10";
- 11 = "WINDOW GOTO 11";
- 12 = "WINDOW GOTO 12";
- 13 = "WINDOW GOTO 13";
- 14 = "WINDOW GOTO 14";
- 15 = "WINDOW GOTO 15";
- 16 = "WINDOW GOTO 16";
- 17 = "WINDOW GOTO 17";
- 18 = "WINDOW GOTO 18";
- 19 = "WINDOW GOTO 19";
- 20 = "WINDOW GOTO 20";
- 21 = "WINDOW GOTO 21";
- 22 = "WINDOW GOTO 22";
- 23 = "WINDOW GOTO 23";
- 24 = "WINDOW GOTO 24";
- 25 = "WINDOW GOTO 25";
- 26 = "WINDOW GOTO 26";
- 27 = "WINDOW GOTO 27";
- 28 = "WINDOW GOTO 28";
- 29 = "WINDOW GOTO 29";
- 30 = "WINDOW GOTO 30";
- 31 = "WINDOW GOTO 31";
- 32 = "WINDOW GOTO 32";
- 33 = "WINDOW GOTO 33";
- 34 = "WINDOW GOTO 34";
- 35 = "WINDOW GOTO 35";
- 36 = "WINDOW GOTO 36";
- 37 = "WINDOW GOTO 37";
- 38 = "WINDOW GOTO 38";
- 39 = "WINDOW GOTO 39";
- 40 = "WINDOW GOTO 40";
- 41 = "WINDOW GOTO 41";
- 42 = "WINDOW GOTO 42";
- 43 = "WINDOW GOTO 43";
- 44 = "WINDOW GOTO 44";
- 45 = "WINDOW GOTO 45";
- 46 = "WINDOW GOTO 46";
- 47 = "WINDOW GOTO 47";
- 48 = "WINDOW GOTO 48";
- 49 = "WINDOW GOTO 49";
- 50 = "WINDOW GOTO 50";
- 51 = "WINDOW GOTO 51";
- 52 = "WINDOW GOTO 52";
- 53 = "WINDOW GOTO 53";
- 54 = "WINDOW GOTO 54";
- 55 = "WINDOW GOTO 55";
- 56 = "WINDOW GOTO 56";
- 57 = "WINDOW GOTO 57";
- 58 = "WINDOW GOTO 58";
- 59 = "WINDOW GOTO 59";
- 60 = "WINDOW GOTO 60";
- 61 = "WINDOW GOTO 61";
- 62 = "WINDOW GOTO 62";
- 63 = "WINDOW GOTO 63";
- 64 = "WINDOW GOTO 64";
- 65 = "WINDOW GOTO 65";
- 66 = "WINDOW GOTO 66";
- 67 = "WINDOW GOTO 67";
- 68 = "WINDOW GOTO 68";
- 69 = "WINDOW GOTO 69";
- 70 = "WINDOW GOTO 70";
- 71 = "WINDOW GOTO 71";
- 72 = "WINDOW GOTO 72";
- 73 = "WINDOW GOTO 73";
- 74 = "WINDOW GOTO 74";
- 75 = "WINDOW GOTO 75";
- 76 = "WINDOW GOTO 76";
- 77 = "WINDOW GOTO 77";
- 78 = "WINDOW GOTO 78";
- 79 = "WINDOW GOTO 79";
- 80 = "WINDOW GOTO 80";
- 81 = "WINDOW GOTO 81";
- 82 = "WINDOW GOTO 82";
- 83 = "WINDOW GOTO 83";
- 84 = "WINDOW GOTO 84";
- 85 = "WINDOW GOTO 85";
- 86 = "WINDOW GOTO 86";
- 87 = "WINDOW GOTO 87";
- 88 = "WINDOW GOTO 88";
- 89 = "WINDOW GOTO 89";
- 90 = "WINDOW GOTO 90";
- 91 = "WINDOW GOTO 91";
- 92 = "WINDOW GOTO 92";
- 93 = "WINDOW GOTO 93";
- 94 = "WINDOW GOTO 94";
- 95 = "WINDOW GOTO 95";
- 96 = "WINDOW GOTO 96";
- 97 = "WINDOW GOTO 97";
- 98 = "WINDOW GOTO 98";
- 99 = "WINDOW GOTO 99";
};
statusbar = {
@@ -281,7 +186,7 @@ statusbar = {
prompt_empty = "{prompt $winname}";
topic = " $topic";
- topic_empty = " Irssi v$J - http://www.irssi.org";
+ topic_empty = " Irssi v$J - https://irssi.org";
lag = "{sb Lag: $0-}";
act = "{sb Act: $0-}";
diff --git a/m4/glib-2.0.m4 b/m4/glib-2.0.m4
deleted file mode 100644
index 2c8760b7..00000000
--- a/m4/glib-2.0.m4
+++ /dev/null
@@ -1,208 +0,0 @@
-# Configure paths for GLIB
-# Owen Taylor 1997-2001
-
-dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
-dnl gthread is specified in MODULES, pass to pkg-config
-dnl
-AC_DEFUN([AM_PATH_GLIB_2_0],
-[dnl
-dnl Get the cflags and libraries from pkg-config
-dnl
-AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
- , enable_glibtest=yes)
-
- pkg_config_args=glib-2.0
- for module in . $4
- do
- case "$module" in
- gmodule)
- pkg_config_args="$pkg_config_args gmodule-2.0"
- ;;
- gmodule-no-export)
- pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
- ;;
- gobject)
- pkg_config_args="$pkg_config_args gobject-2.0"
- ;;
- gthread)
- pkg_config_args="$pkg_config_args gthread-2.0"
- ;;
- esac
- done
-
- PKG_PROG_PKG_CONFIG([0.7])
-
- no_glib=""
-
- if test "x$PKG_CONFIG" = x ; then
- no_glib=yes
- PKG_CONFIG=no
- fi
-
- min_glib_version=ifelse([$1], ,2.0.0,$1)
- AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
-
- if test x$PKG_CONFIG != xno ; then
- ## don't try to run the test against uninstalled libtool libs
- if $PKG_CONFIG --uninstalled $pkg_config_args; then
- echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
- enable_glibtest=no
- fi
-
- if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
- :
- else
- no_glib=yes
- fi
- fi
-
- if test x"$no_glib" = x ; then
- GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
- GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
- GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
-
- GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
- GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
- glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test "x$enable_glibtest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $GLIB_CFLAGS"
- LIBS="$GLIB_LIBS $LIBS"
-dnl
-dnl Now check if the installed GLIB is sufficiently new. (Also sanity
-dnl checks the results of pkg-config to some extent)
-dnl
- rm -f conf.glibtest
- AC_TRY_RUN([
-#include
-#include
-#include
-
-int
-main ()
-{
- int major, minor, micro;
- char *tmp_version;
-
- system ("touch conf.glibtest");
-
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = g_strdup("$min_glib_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
- printf("%s, bad version string\n", "$min_glib_version");
- exit(1);
- }
-
- if ((glib_major_version != $glib_config_major_version) ||
- (glib_minor_version != $glib_config_minor_version) ||
- (glib_micro_version != $glib_config_micro_version))
- {
- printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
- $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
- glib_major_version, glib_minor_version, glib_micro_version);
- printf ("*** was found! If pkg-config was correct, then it is best\n");
- printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
- printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
- printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
- printf("*** required on your system.\n");
- printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
- printf("*** to point to the correct configuration files\n");
- }
- else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
- (glib_minor_version != GLIB_MINOR_VERSION) ||
- (glib_micro_version != GLIB_MICRO_VERSION))
- {
- printf("*** GLIB header files (version %d.%d.%d) do not match\n",
- GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
- printf("*** library (version %d.%d.%d)\n",
- glib_major_version, glib_minor_version, glib_micro_version);
- }
- else
- {
- if ((glib_major_version > major) ||
- ((glib_major_version == major) && (glib_minor_version > minor)) ||
- ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
- {
- return 0;
- }
- else
- {
- printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
- glib_major_version, glib_minor_version, glib_micro_version);
- printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
- major, minor, micro);
- printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
- printf("***\n");
- printf("*** If you have already installed a sufficiently new version, this error\n");
- printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
- printf("*** being found. The easiest way to fix this is to remove the old version\n");
- printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
- printf("*** correct copy of pkg-config. (In this case, you will have to\n");
- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
- printf("*** so that the correct libraries are found at run-time))\n");
- }
- }
- return 1;
-}
-],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- if test "x$no_glib" = x ; then
- AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
- ifelse([$2], , :, [$2])
- else
- AC_MSG_RESULT(no)
- if test "$PKG_CONFIG" = "no" ; then
- echo "*** A new enough version of pkg-config was not found."
- echo "*** See http://www.freedesktop.org/software/pkgconfig/"
- else
- if test -f conf.glibtest ; then
- :
- else
- echo "*** Could not run GLIB test program, checking why..."
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $GLIB_CFLAGS"
- LIBS="$LIBS $GLIB_LIBS"
- AC_TRY_LINK([
-#include
-#include
-], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding GLIB or finding the wrong"
- echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occurred. This usually means GLIB is incorrectly installed."])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- GLIB_CFLAGS=""
- GLIB_LIBS=""
- GLIB_GENMARSHAL=""
- GOBJECT_QUERY=""
- GLIB_MKENUMS=""
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(GLIB_CFLAGS)
- AC_SUBST(GLIB_LIBS)
- AC_SUBST(GLIB_GENMARSHAL)
- AC_SUBST(GOBJECT_QUERY)
- AC_SUBST(GLIB_MKENUMS)
- rm -f conf.glibtest
-])
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..bb6d2829
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,991 @@
+project(
+ 'irssi',
+ 'c',
+ version : '1.5-head',
+ meson_version : '>=0.53',
+ default_options : [ 'warning_level=1' ],
+)
+
+############################
+############################
+
+glib_internal_version = 'glib-2.74.7' # keep this in sync with subprojects/glib.wrap
+glib_pcre2_internal_version = 'pcre2-10.40'
+glib_libffi_internal_version = 'libffi'
+cc = meson.get_compiler('c')
+rootinc = include_directories('.')
+dep = [ ]
+textui_dep = [ ]
+need_dl_cross_link = false
+need_dl_cross_link_main = false
+dl_cross_irssi_main = [ ]
+# The Android environment requires that all modules are linked to each other.
+# See https://github.com/android/ndk/issues/201
+if host_machine.system() == 'android'
+ need_dl_cross_link = true
+elif host_machine.system() == 'cygwin'
+ need_dl_cross_link = true
+ need_dl_cross_link_main = true
+endif
+
+includedir = get_option('includedir')
+incdir = 'irssi'
+moduledir = get_option('libdir') / incdir / 'modules'
+helpdir = get_option('datadir') / incdir / 'help'
+themedir = get_option('datadir') / incdir / 'themes'
+scriptdir = get_option('datadir') / incdir / 'scripts'
+docdir = get_option('docdir') != '' ? get_option('docdir') : (get_option('datadir') / 'doc' / incdir)
+
+want_textui = get_option('without-textui') != 'yes'
+want_bot = get_option('with-bot') == 'yes'
+want_fuzzer = get_option('with-fuzzer') == 'yes'
+fuzzer_lib = get_option('with-fuzzer-lib')
+fuzzer_link_language = get_option('fuzzer-link-language')
+want_proxy = get_option('with-proxy') == 'yes'
+
+require_capsicum = get_option('with-capsicum') == 'yes'
+want_capsicum = get_option('with-capsicum') != 'no'
+
+require_libutf8proc = get_option('disable-utf8proc') == 'no'
+want_libutf8proc = get_option('disable-utf8proc') != 'yes'
+
+require_perl = get_option('with-perl') == 'yes'
+want_perl = get_option('with-perl') != 'no'
+with_perl_lib = get_option('with-perl-lib')
+
+require_otr = get_option('with-otr') == 'yes'
+want_otr = get_option('with-otr') != 'no'
+
+want_glib_internal = get_option('install-glib') != 'no'
+require_glib_internal = get_option('install-glib') == 'force'
+
+want_static_dependency = get_option('static-dependency') == 'yes'
+
+package_version = get_option('PACKAGE_VERSION') != '' ? get_option('PACKAGE_VERSION') : meson.project_version()
+
+fs = import('fs')
+if fs.exists('config.status') or fs.exists('irssi-version.h') or fs.exists('default-config.h') or fs.exists('default-theme.h') or fs.exists('src/perl/irssi-core.pl.h') or fs.exists('src/perl/perl-signals-list.h') or fs.exists('irssi-config.h')
+ error('this tree has been configured with autotools, cannot proceed')
+endif
+
+UNSET = '=INVALID='
+UNSET_ARR = [ UNSET ]
+
+chat_modules = [ 'irc' ]
+
+run_command(
+ 'mkdir',
+ meson.current_build_dir() / incdir,
+ check : false,
+)
+run_command(
+ 'ln',
+ '-s', meson.current_source_dir() / 'src',
+ meson.current_build_dir() / incdir,
+ check : false,
+)
+run_command(
+ 'ln',
+ '-s', meson.current_build_dir() / 'irssi-config.h',
+ meson.current_build_dir() / incdir,
+ check : false,
+)
+run_command(
+ 'ln',
+ '-s', meson.current_build_dir() / 'irssi-version.h',
+ meson.current_build_dir() / incdir,
+ check : false,
+)
+
+def_moduledir = '-D' + 'MODULEDIR' + '="' + (get_option('prefix') / moduledir) + '"'
+def_sysconfdir = '-D' + 'SYSCONFDIR' + '="' + (get_option('prefix') / get_option('sysconfdir')) + '"'
+def_helpdir = '-D' + 'HELPDIR' + '="' + (get_option('prefix') / helpdir) + '"'
+def_themesdir = '-D' + 'THEMESDIR' + '="' + (get_option('prefix') / themedir) + '"'
+def_scriptdir = '-D' + 'SCRIPTDIR' + '="' + (get_option('prefix') / scriptdir) + '"'
+
+def_suppress_printf_fallback = '-D' + 'SUPPRESS_PRINTF_FALLBACK'
+
+module_suffix = [ ]
+perl_module_suffix = [ ]
+# Meson uses the wrong module extensions on Mac.
+# https://gitlab.gnome.org/GNOME/glib/issues/520
+if [ 'darwin', 'ios' ].contains(host_machine.system())
+ module_suffix = 'so'
+ perl_module_suffix = 'bundle'
+endif
+
+##############
+# Help files #
+##############
+
+build_perl = find_program(
+ 'perl',
+ native : true,
+)
+if meson.is_cross_build()
+ cross_perl = find_program('perl')
+else
+ cross_perl = build_perl
+endif
+run_command(
+ build_perl,
+ files('utils/syntax.pl'),
+ check : true,
+)
+
+###################
+# irssi-version.h #
+###################
+
+env = find_program('env')
+irssi_version_sh = find_program('utils/irssi-version.sh')
+irssi_version_h = custom_target(
+ 'irssi-version.h',
+ build_by_default : true,
+ build_always_stale : true,
+ capture : true,
+ command : [ env, 'VERSION=' + meson.project_version(), irssi_version_sh, meson.current_source_dir() ],
+ output : 'irssi-version.h',
+ install : true,
+ install_dir : includedir / incdir,
+)
+
+####################
+# default-config.h #
+####################
+
+file2header = find_program('utils/file2header.sh')
+default_config_h = custom_target(
+ 'default-config.h',
+ input : files('irssi.conf'),
+ output : 'default-config.h',
+ capture : true,
+ command : [ file2header, '@INPUT@', 'default_config' ],
+)
+
+###################
+# default-theme.h #
+###################
+
+default_theme_h = custom_target(
+ 'default-theme.h',
+ input : files('themes/default.theme'),
+ output : 'default-theme.h',
+ capture : true,
+ command : [ file2header, '@INPUT@', 'default_theme' ],
+)
+
+################
+# Dependencies #
+################
+
+#### inet_addr ####
+inet_addr_found = false
+foreach inet_addr_provider : [ '', 'nsl' ]
+ prov_lib = [ ]
+ if inet_addr_provider != ''
+ prov_lib += cc.find_library(
+ inet_addr_provider,
+ required : false,
+ )
+ endif
+ if (prov_lib.length() == 0 or prov_lib[0].found()) and cc.has_function(
+ 'inet_addr',
+ dependencies : prov_lib,
+ )
+ dep += prov_lib
+ inet_addr_found = true
+ break
+ endif
+endforeach
+if not inet_addr_found
+ error('inet_addr not found')
+endif
+
+#### socket ####
+socket_found = false
+foreach socket_provider : [ '', 'socket', 'network' ]
+ prov_lib = [ ]
+ if socket_provider != ''
+ prov_lib += cc.find_library(
+ socket_provider,
+ required : false,
+ )
+ endif
+ if (prov_lib.length() == 0 or prov_lib[0].found()) and cc.has_function(
+ 'socket',
+ dependencies : prov_lib,
+ )
+ dep += prov_lib
+ socket_found = true
+ break
+ endif
+endforeach
+if not socket_found
+ error('socket not found')
+endif
+
+built_src = [ ]
+glib_internal = false
+message('*** If you don\'t have GLib, you can run meson ... -Dinstall-glib=yes')
+message('*** to download and build it automatically')
+message('*** Or alternatively install your distribution\'s package')
+message('*** On Debian: sudo apt-get install libglib2.0-dev')
+message('*** On Redhat: dnf install glib2-devel')
+if not require_glib_internal
+ glib_dep = dependency(
+ 'glib-2.0',
+ version : '>=2.32',
+ required : not want_glib_internal,
+ static : want_static_dependency,
+ include_type : 'system',
+ )
+else
+ glib_dep = dependency(
+ '',
+ required : false,
+ )
+endif
+if not glib_dep.found()
+ glib_internal = true
+ meson_cmd = find_program('meson')
+ ninja = find_program('ninja')
+
+ glib_internal_download_t = custom_target(
+ 'glib-internal-download',
+ command : [ meson_cmd, 'subprojects', 'download', 'glib', '--sourcedir', meson.current_source_dir() ],
+ console : true,
+ output : [ 'glib-internal-download' ],
+ )
+
+ glib_internal_dependencies = [
+ dependency('threads'),
+ ]
+ glib_internal_configure_args = [ ]
+
+ glib_internal_usr_local = false
+ if not cc.has_function('iconv_open')
+ prov_lib = cc.find_library(
+ 'iconv',
+ required : false,
+ )
+ if not prov_lib.found()
+ prov_lib = cc.find_library(
+ 'iconv',
+ dirs : '/usr/local/lib',
+ )
+ glib_internal_usr_local = true
+ endif
+ glib_internal_dependencies += prov_lib
+ endif
+
+ if not cc.has_function('ngettext')
+ prov_lib = cc.find_library(
+ 'intl',
+ required : false,
+ )
+ if not prov_lib.found()
+ prov_lib = cc.find_library(
+ 'intl',
+ dirs : '/usr/local/lib',
+ )
+ glib_internal_usr_local = true
+ endif
+ glib_internal_dependencies += prov_lib
+ endif
+
+ if glib_internal_usr_local
+ glib_internal_configure_args += [ '-Dc_args=-I/usr/local/include', '-Dc_link_args=-L/usr/local/lib' ]
+ endif
+
+ if not cc.has_function('getxattr') or not cc.has_header('sys/xattr.h')
+ if cc.has_header_symbol('attr/xattr.h', 'getxattr')
+ prov_lib = cc.find_library(
+ 'xattr',
+ required : false,
+ )
+ else
+ prov_lib = dependency(
+ '',
+ required : false,
+ )
+ endif
+ if prov_lib.found()
+ glib_internal_dependencies += prov_lib
+ else
+ glib_internal_configure_args += '-Dxattr=false'
+ endif
+ endif
+
+ glib_internal_configure_t = custom_target(
+ 'glib-internal-configure',
+ command : [
+ meson_cmd,
+ 'setup',
+ '--prefix=/irssi-glib-internal',
+ '--buildtype=' + get_option('buildtype'),
+ '-Dlibmount=disabled',
+ '-Dselinux=disabled',
+ '-Ddefault_library=static',
+ '-Dforce_fallback_for=pcre2,libffi',
+ glib_internal_configure_args,
+ (meson.current_build_dir() / 'build-subprojects' / 'glib'),
+ (meson.current_source_dir() / 'subprojects' / glib_internal_version),
+ ],
+ console : true,
+ output : [ 'glib-internal-configure' ],
+ depends : glib_internal_download_t,
+ )
+ glib_internal_build_t = custom_target(
+ 'glib-internal-build',
+ command : [
+ ninja,
+ '-C', meson.current_build_dir() / 'build-subprojects' / 'glib',
+ 'subprojects' / glib_libffi_internal_version / 'src' / 'libffi.a',
+ 'subprojects' / glib_pcre2_internal_version / 'libpcre2-8.a',
+ 'glib' / 'libglib-2.0.a',
+ 'gmodule' / 'libgmodule-2.0.a',
+ 'gobject' / 'libgobject-2.0.a',
+ 'gio' / 'libgio-2.0.a',
+ ],
+ console : true,
+ output : [ 'glib-internal-build' ],
+ depends : glib_internal_configure_t,
+ )
+ glib_dep = declare_dependency(
+ dependencies : glib_internal_dependencies,
+ sources : glib_internal_build_t,
+ compile_args : [
+ '-isystem' + (meson.current_source_dir() / 'subprojects' / glib_internal_version / 'glib'),
+ '-isystem' + (meson.current_source_dir() / 'subprojects' / glib_internal_version),
+ '-isystem' + (meson.current_build_dir() / 'build-subprojects' / 'glib' / 'glib'),
+ ],
+ link_args : [
+ meson.current_build_dir() / 'build-subprojects' / 'glib' / 'subprojects' / glib_pcre2_internal_version / 'libpcre2-8.a',
+ meson.current_build_dir() / 'build-subprojects' / 'glib' / 'glib' / 'libglib-2.0.a',
+ ],
+ )
+ built_src += glib_internal_build_t
+ libdl_dep = [ ]
+ prov_lib = cc.find_library(
+ 'dl',
+ required : false,
+ )
+ if prov_lib.found() and cc.has_function(
+ 'dlopen',
+ dependencies : prov_lib,
+ )
+ libdl_dep += prov_lib
+ endif
+ gmodule_dep = declare_dependency(
+ sources : glib_internal_build_t,
+ dependencies : libdl_dep,
+ compile_args : [
+ '-isystem' + (meson.current_source_dir() / 'subprojects' / glib_internal_version / 'gmodule'),
+ ],
+ link_args : [ meson.current_build_dir() / 'build-subprojects' / 'glib' / 'gmodule' / 'libgmodule-2.0.a' ],
+ )
+ gobject_dep = declare_dependency(
+ sources : glib_internal_build_t,
+ compile_args : [
+ '-isystem' + (meson.current_build_dir() / 'build-subprojects' / 'glib'),
+ ],
+ link_args : [
+ meson.current_build_dir() / 'build-subprojects' / 'glib' / 'subprojects' / glib_libffi_internal_version / 'src' / 'libffi.a',
+ meson.current_build_dir() / 'build-subprojects' / 'glib' / 'gobject' / 'libgobject-2.0.a',
+ ],
+ )
+ gio_dep = declare_dependency(
+ sources : glib_internal_build_t,
+ dependencies : cc.find_library('z'),
+ compile_args : [
+ '-isystem' + (meson.current_source_dir() / 'subprojects' / glib_internal_version / 'gio'),
+ '-isystem' + (meson.current_build_dir() / 'build-subprojects' / 'glib'),
+ ],
+ link_args : [ meson.current_build_dir() / 'build-subprojects' / 'glib' / 'gio' / 'libgio-2.0.a' ],
+ )
+else
+ gmodule_dep = dependency(
+ 'gmodule-2.0',
+ static : want_static_dependency,
+ include_type : 'system',
+ )
+ gobject_dep = dependency(
+ 'gobject-2.0',
+ static : want_static_dependency,
+ include_type : 'system',
+ )
+ gio_dep = dependency(
+ 'gio-2.0',
+ static : want_static_dependency,
+ include_type : 'system',
+ )
+endif
+dep += glib_dep
+dep += gmodule_dep
+dep += gobject_dep
+dep += gio_dep
+
+if glib_internal and want_static_dependency and want_fuzzer
+ openssl_proj = subproject(
+ 'openssl',
+ default_options : [ 'default_library=static', 'asm=disabled' ],
+ )
+ openssl_dep = openssl_proj.get_variable('openssl_dep')
+else
+ openssl_dep = dependency(
+ 'openssl',
+ static : want_static_dependency,
+ include_type : 'system',
+ )
+endif
+dep += openssl_dep
+
+############
+# utf8proc #
+############
+
+have_libutf8proc = false
+libutf8proc = [ ]
+if want_libutf8proc
+ libutf8proc = cc.find_library(
+ 'utf8proc',
+ required : require_libutf8proc,
+ )
+ have_libutf8proc = cc.has_function(
+ 'utf8proc_version',
+ dependencies : libutf8proc,
+ )
+ if have_libutf8proc
+ dep += libutf8proc
+ endif
+endif
+
+############################
+############################
+
+############
+# terminfo #
+############
+
+if want_textui
+ setupterm_found = false
+ foreach setupterm_provider : [ 'tinfo', 'ncursesw', 'ncurses', 'terminfo' ]
+ prov_lib = cc.find_library(
+ setupterm_provider,
+ required : false,
+ )
+ if prov_lib.found() and cc.has_function(
+ 'setupterm',
+ dependencies : prov_lib,
+ )
+ textui_dep += prov_lib
+ setupterm_found = true
+ break
+ endif
+ endforeach
+ if not setupterm_found
+ error('Terminfo not found')
+ endif
+endif
+
+########
+# perl #
+########
+
+have_perl = false
+if want_perl
+ perl_cflags = [ ]
+ perl_ldflags = [ ]
+ perl_rpath_flags = [ ]
+ perl_rpath = ''
+
+ #### ccopts ####
+ perl_ccopts = meson.get_cross_property('perl_ccopts', UNSET_ARR)
+ if perl_ccopts == UNSET_ARR
+ res = run_command(
+ cross_perl,
+ '-MExtUtils::Embed',
+ '-e', 'ccopts',
+ check : true,
+ )
+ perl_ccopts = res.stdout().strip().split()
+ endif
+ foreach fl : perl_ccopts
+ if fl.startswith('-D') or fl.startswith('-U') or fl.startswith('-I') or fl.startswith('-i') or fl.startswith('-f') or fl.startswith('-m')
+ if fl.startswith('-I')
+ fl = '-isystem' + fl.split('-I')[1]
+ endif
+ perl_cflags += fl
+ endif
+ endforeach
+
+ perl_cflags += cc.get_supported_arguments('-fPIC')
+
+ #### ldopts ####
+ perl_ldopts = meson.get_cross_property('perl_ldopts', UNSET_ARR)
+ if perl_ldopts == UNSET_ARR
+ res = run_command(
+ cross_perl,
+ '-MExtUtils::Embed',
+ '-e', 'ldopts',
+ check : true,
+ )
+ perl_ldopts = res.stdout().strip().split()
+ endif
+ skip_libs = [ '-ldb', '-ldbm', '-lndbm', '-lgdbm', '-lc', '-lposix', '-rdynamic' ]
+ foreach fl : perl_ldopts
+ if not fl.startswith('-A') and not skip_libs.contains(fl)
+ if fl.startswith('-Wl,-rpath,')
+ perl_rpath = fl.split(',')[2]
+ perl_rpath_flags += fl
+ else
+ perl_ldflags += fl
+ endif
+ endif
+ endforeach
+
+ perl_version = meson.get_cross_property('perl_version', UNSET)
+ if perl_version == UNSET
+ perl_version = run_command(
+ cross_perl,
+ '-V::version:',
+ check : true,
+ ).stdout().split('\'')[1]
+ endif
+
+ # disable clang warning
+ if perl_version.version_compare('<5.35.2')
+ perl_cflags += cc.get_supported_arguments('-Wno-compound-token-split-by-macro')
+ endif
+ perl_dep = declare_dependency(
+ compile_args : perl_cflags,
+ link_args : perl_ldflags,
+ version : perl_version,
+ )
+
+ ####
+ if not cc.links(
+ '''
+#include
+#include
+int main()
+{
+ perl_alloc();
+ return 0;
+}
+''',
+ args : perl_cflags + perl_ldflags + perl_rpath_flags,
+ name : 'working Perl support',
+ )
+ if require_perl
+ error('error linking with perl libraries')
+ else
+ warning('error linking with perl libraries')
+ endif
+ else
+ xsubpp_file_c = meson.get_cross_property('perl_xsubpp', UNSET)
+ if xsubpp_file_c == UNSET
+ xsubpp_file_c = run_command(
+ build_perl,
+ '-MExtUtils::ParseXS',
+ '-e($r = $INC{"ExtUtils/ParseXS.pm"}) =~ s{ParseXS\\.pm$}{xsubpp}; print $r',
+ check : true,
+ ).stdout()
+ endif
+ xsubpp = generator(
+ build_perl,
+ output : '@BASENAME@.c',
+ capture : true,
+ arguments : [ xsubpp_file_c, '@EXTRA_ARGS@', '@INPUT@' ],
+ )
+ xsubpp_file = files(xsubpp_file_c)
+
+ if with_perl_lib == 'module'
+ perl_install_base = run_command(
+ build_perl,
+ '-MText::ParseWords=shellwords',
+ '-e', 'grep { s/^INSTALL_BASE=// && print && exit } shellwords $ENV{PERL_MM_OPT}',
+ check : true,
+ ).stdout()
+ if perl_install_base == ''
+ with_perl_lib = ''
+ endif
+ endif
+ if with_perl_lib == ''
+ if get_option('prefix') in [ '/usr/local', 'C:/' ]
+ with_perl_lib = 'site'
+ elif get_option('prefix') in [ '/usr' ]
+ with_perl_lib = 'vendor'
+ endif
+ endif
+ perlmoddir = ''
+ if with_perl_lib in [ 'site', 'vendor', 'module' ]
+ set_perl_use_lib = false
+ perl_library_dir = with_perl_lib + ' default'
+ if with_perl_lib in [ 'site', 'vendor' ]
+ perlmoddir = meson.get_cross_property('perl_install' + with_perl_lib + 'arch', UNSET)
+ if perlmoddir == UNSET
+ perlmoddir = run_command(
+ cross_perl,
+ '-V::install' + with_perl_lib + 'arch:',
+ check : true,
+ ).stdout().split('\'')[1]
+ endif
+ elif with_perl_lib == 'module'
+ perl_archname = meson.get_cross_property('perl_archname', UNSET)
+ if perl_archname == UNSET
+ perl_archname = run_command(
+ cross_perl,
+ '-V::archname:',
+ check : true,
+ ).stdout().split('\'')[1]
+ endif
+ perlmoddir = perl_install_base / 'lib' / 'perl5' / perl_archname
+ endif
+ elif with_perl_lib == ''
+ set_perl_use_lib = true
+ perl_library_dir = 'in prefix'
+ perlmoddir = get_option('libdir') / incdir / 'perl'
+ elif with_perl_lib.startswith('/')
+ set_perl_use_lib = true
+ perl_library_dir = 'custom'
+ perlmoddir = with_perl_lib
+ endif
+ if perlmoddir == ''
+ error('Unrecognised with-perl-lib value: ' + with_perl_lib)
+ endif
+
+ perl_use_lib = get_option('prefix') / perlmoddir
+ if set_perl_use_lib
+ perl_inc = meson.get_cross_property('perl_inc', UNSET_ARR)
+ if perl_inc == UNSET_ARR
+ set_perl_use_lib = run_command(
+ cross_perl,
+ '-e', 'exit ! grep $_ eq $ARGV[0], grep /^\\//, @INC',
+ perl_use_lib,
+ check : false,
+ ).returncode() != 0
+ else
+ set_perl_use_lib = not perl_inc.contains(perl_use_lib)
+ endif
+ if not set_perl_use_lib
+ perl_library_dir += ' - other path in @INC'
+ else
+ perl_library_dir += ' - prepends to @INC with /set perl_use_lib'
+ endif
+ endif
+ def_perl_use_lib = '-D' + 'PERL_USE_LIB' + '="'
+ if set_perl_use_lib
+ def_perl_use_lib += perl_use_lib
+ endif
+ def_perl_use_lib += '"'
+
+ have_perl = true
+ endif
+endif
+
+#######
+# OTR #
+#######
+
+have_otr = false
+if want_otr
+ libgcrypt = dependency(
+ 'libgcrypt',
+ version : '>=1.2.0',
+ required : require_otr,
+ static : want_static_dependency,
+ include_type : 'system',
+ )
+ libotr = dependency(
+ 'libotr',
+ version : '>=4.1.0',
+ required : require_otr,
+ static : want_static_dependency,
+ include_type : 'system',
+ )
+ if libgcrypt.found() and libotr.found()
+ dep += libgcrypt
+ dep += libotr
+ have_otr = true
+ endif
+endif
+
+############
+# capsicum #
+############
+
+have_capsicum = false
+if want_capsicum
+ if cc.has_function(
+ 'cap_enter',
+ dependencies : cc.find_library('c'),
+ )
+ libnv = cc.find_library(
+ 'nv',
+ required : require_capsicum,
+ )
+ nvlist_create_found = libnv.found() and cc.has_function(
+ 'nvlist_create',
+ dependencies : libnv,
+ prefix : '#include ',
+ )
+ if nvlist_create_found
+ dep += libnv
+ have_capsicum = true
+ else
+ if require_capsicum
+ error('nvlist_create not found')
+ endif
+ endif
+ else
+ if require_capsicum
+ error('cap_enter not found')
+ endif
+ endif
+endif
+
+# dependency helper sets
+dep_cflagsonly = [ ]
+foreach d : dep
+ dep_cflagsonly += d.partial_dependency(
+ includes : true,
+ compile_args : true,
+ )
+endforeach
+dl_cross_dep = [ ]
+if need_dl_cross_link
+ dl_cross_dep = dep
+endif
+
+##################
+# irssi-config.h #
+##################
+
+conf = configuration_data()
+
+conf.set(
+ 'HAVE_CAPSICUM',
+ have_capsicum,
+ description : 'Build with Capsicum support',
+)
+conf.set('HAVE_GMODULE', true)
+conf.set('TERM_TRUECOLOR', true)
+conf.set('USE_GREGEX', true)
+conf.set10(
+ '_DARWIN_USE_64_BIT_INODE',
+ true,
+ description : 'Enable large inode numbers on Mac OS X 10.5.',
+)
+conf.set_quoted('FHS_PREFIX', get_option('fhs-prefix'))
+
+headers = [
+ 'sys/ioctl.h',
+ 'sys/resource.h',
+ 'sys/time.h',
+ 'sys/utsname.h',
+ 'dirent.h',
+ 'term.h',
+ 'unistd.h',
+]
+foreach h : headers
+ if cc.has_header(h)
+ conf.set(
+ 'HAVE_' + h.underscorify().to_upper(),
+ 1,
+ description : 'Define to 1 if you have the <' + h + '> header file.',
+ )
+ endif
+endforeach
+
+if want_textui and conf.get('HAVE_TERM_H', 0) == 1
+ if cc.links(
+ '''
+#include
+#include
+int main (void) {
+ return tputs("x", 1, putchar);
+}
+''',
+ args : '-pedantic-errors',
+ dependencies : textui_dep,
+ name : 'Curses working',
+ )
+ # ok
+ else
+ has_curses_h = cc.has_header('curses.h')
+ if has_curses_h and cc.links(
+ '''
+#include
+#include
+int main (void) {
+ return tputs("x", 1, putchar);
+}
+''',
+ args : '-pedantic-errors',
+ dependencies : textui_dep,
+ name : 'Curses working with curses.h',
+ )
+ conf.set(
+ 'NEED_CURSES_H',
+ 1,
+ description : 'tputs needs curses.h',
+ )
+ else
+ if has_curses_h and cc.links(
+ '''
+#include
+#include
+int char_putchar (char c) {
+ return putchar(c);
+}
+int main (void) {
+ return tputs("x", 1, char_putchar);
+}
+''',
+ args : '-pedantic-errors',
+ dependencies : textui_dep,
+ name : 'Curses with tputs third argument arg char',
+ )
+ conf.set(
+ 'NEED_CURSES_H',
+ 1,
+ description : 'tputs needs curses.h',
+ )
+ conf.set(
+ 'TPUTS_SVR4',
+ 1,
+ description : 'third argument of tputs has the type int (*)(char)',
+ )
+ else
+ error('could not link terminfo')
+ endif
+ endif
+ endif
+endif
+
+conf.set('HAVE_LIBUTF8PROC', have_libutf8proc)
+conf.set_quoted('PACKAGE_VERSION', package_version)
+conf.set_quoted('PACKAGE_TARNAME', meson.project_name())
+
+configure_file(
+ output : 'irssi-config.h',
+ configuration : conf,
+ install_dir : includedir / incdir,
+)
+
+##########
+# CFLAGS #
+##########
+
+#### warnings ####
+add_project_arguments(
+ cc.get_supported_arguments('-Werror=declaration-after-statement'),
+ language : 'c',
+)
+
+#### personality ####
+add_project_arguments(
+ cc.get_supported_arguments('-fno-strict-aliasing'),
+ language : 'c',
+)
+if get_option('buildtype').contains('debug')
+ add_project_arguments(
+ cc.get_supported_arguments('-fno-omit-frame-pointer'),
+ language : 'c',
+ )
+endif
+
+if want_fuzzer
+ if fuzzer_lib.startswith('-fsanitize=fuzzer')
+ if not cc.has_argument('-fsanitize=fuzzer-no-link')
+ error('compiler does not support -fsanitize=fuzzer-no-link, try clang?')
+ endif
+ add_project_arguments(
+ '-fsanitize=fuzzer-no-link',
+ language : 'c',
+ )
+ endif
+ if fuzzer_link_language != 'c'
+ add_languages(fuzzer_link_language)
+ endif
+endif
+
+##############
+# irssi-1.pc #
+##############
+
+pc = import('pkgconfig')
+pc_requires = [ ]
+if not glib_internal
+ pc_requires += glib_dep
+endif
+signalsfile = docdir / 'signals.txt'
+if signalsfile.startswith('/')
+ signalsfile = signalsfile.split(get_option('prefix'))
+ if signalsfile[0] == ''
+ signalsfile = '${prefix}' + signalsfile[1]
+ else
+ signalsfile = signalsfile[0]
+ endif
+else
+ signalsfile = '${prefix}' / signalsfile
+endif
+pc.generate(
+ filebase : 'irssi-1',
+ name : 'Irssi',
+ description : 'Irssi chat client',
+ version : package_version,
+ requires : pc_requires,
+ variables : [ 'irssimoduledir=${libdir}' / incdir / 'modules', 'signalsfile=' + signalsfile ],
+)
+
+###########
+# irssi.1 #
+###########
+
+install_man('docs/irssi.1')
+
+###########
+# subdirs #
+###########
+
+subdir('src')
+subdir('tests')
+subdir('docs')
+subdir('scripts')
+subdir('themes')
+# subdir('utils')
+
+############################
+############################
+
+message('*** Irssi configured ***')
+message('')
+message('Building text frontend ........... : ' + want_textui.to_string('yes', 'no'))
+message('Building irssi bot ............... : ' + want_bot.to_string('yes', 'no'))
+message('Building irssi proxy ............. : ' + want_proxy.to_string('yes', 'no'))
+if want_perl and not have_perl
+ message('Building with Perl support ....... : NO!')
+ message(' - Try: sudo apt-get install libperl-dev')
+ message(' - Or: dnf install perl-devel')
+else
+ message('Building with Perl support ....... : ' + have_perl.to_string('yes', 'no'))
+endif
+if have_perl
+ message('Perl library directory ........... : ' + perl_use_lib)
+ message(' ' + perl_library_dir)
+endif
+message('Install prefix ................... : ' + get_option('prefix'))
+message('')
+message('Building with Capsicum ........... : ' + have_capsicum.to_string('yes', 'no'))
+message('Building with utf8proc ........... : ' + have_libutf8proc.to_string('yes', 'no'))
+message('Building with OTR support ........ : ' + have_otr.to_string('yes', 'no'))
+message('')
+message('If there are any problems, read the INSTALL file.')
+message('Now type ninja -C ' + meson.current_build_dir() + ' to build Irssi')
+message('')
+
+############################
+############################
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 00000000..a5b4ffbb
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,16 @@
+option('without-textui', type : 'combo', description : 'Build without text frontend', choices : ['no', 'yes'])
+option('with-bot', type : 'combo', description : 'Build irssi-bot', choices : ['no', 'yes'])
+option('with-fuzzer', type : 'combo', description : 'Build irssi-fuzzer', choices : ['no', 'yes'])
+option('with-fuzzer-lib', type : 'string', description : 'Specify path to fuzzer library', value : '-fsanitize=fuzzer')
+option('fuzzer-link-language', type : 'string', description : 'The linker to use for the fuzz targets [c, cpp]', value : 'c')
+option('with-proxy', type : 'combo', description : 'Build irssi-proxy', choices : ['no', 'yes'])
+option('with-perl-lib', type : 'string', description : 'Specify where to install the Perl libraries for Irssi')
+option('with-perl', type : 'combo', description : 'Build with Perl support', choices : ['auto', 'yes', 'no'])
+option('with-otr', type : 'combo', description : 'Build with OTR support', choices : ['auto', 'yes', 'no'])
+option('disable-utf8proc', type : 'combo', description : 'Build without Julia\'s utf8proc', choices : ['auto', 'yes', 'no'])
+option('with-capsicum', type : 'combo', description : 'Build with Capsicum support', choices : ['auto', 'yes', 'no'])
+option('static-dependency', type : 'combo', description : 'Request static dependencies', choices : ['no', 'yes'])
+option('install-glib', type : 'combo', description : 'Download and install GLib for you', choices : ['no', 'yes', 'force'])
+option('docdir', type : 'string', description : 'Documentation directory')
+option('fhs-prefix', type : 'string', description : 'System prefix for Termux')
+option('PACKAGE_VERSION', type : 'string', description : 'Override PACKAGE_VERSION in tarballs')
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
deleted file mode 100644
index cd795153..00000000
--- a/scripts/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-SUBDIRS = examples
-
-scriptdir = $(datadir)/irssi/scripts
-
-script_DATA = \
- autoop.pl \
- autorejoin.pl \
- buf.pl \
- dns.pl \
- kills.pl \
- mail.pl \
- mlock.pl \
- quitmsg.pl \
- scriptassist.pl \
- usercount.pl
-
-EXTRA_DIST = $(script_DATA)
diff --git a/scripts/autoop.pl b/scripts/autoop.pl
index b72def15..ce37e705 100644
--- a/scripts/autoop.pl
+++ b/scripts/autoop.pl
@@ -5,7 +5,7 @@ use Irssi;
use strict;
use vars qw($VERSION %IRSSI);
-$VERSION = "1.10";
+$VERSION = "1.11";
%IRSSI = (
authors => 'Timo Sirainen & Jostein Kjønigsen',
name => 'autoop',
@@ -98,10 +98,11 @@ sub load_autoops {
%opnicks = ();
open(CONF, "<", "$file") or return;
while (my $line = ) {
- if ($line !=~ /^\s*$/) {
- cmd_autoop($line);
- $count++;
- }
+ chomp($line);
+ if ($line !~ /^\s*$/) {
+ cmd_autoop($line);
+ $count++;
+ }
}
close(CONF);
diff --git a/scripts/autorejoin.pl b/scripts/autorejoin.pl
index 42c97da7..e5be21b2 100644
--- a/scripts/autorejoin.pl
+++ b/scripts/autorejoin.pl
@@ -1,6 +1,9 @@
-# automatically rejoin to channel after kick
+# automatically rejoin to channel after kicked
# delayed rejoin: Lam 28.10.2001 (lam@lac.pl)
+# /SET autorejoin_channels #channel1 #channel2 ...
+# /SET autorejoin_delay 5
+
# NOTE: I personally don't like this feature, in most channels I'm in it
# will just result as ban. You've probably misunderstood the idea of /KICK
# if you kick/get kicked all the time "just for fun" ...
@@ -9,31 +12,22 @@ use Irssi;
use Irssi::Irc;
use strict;
use vars qw($VERSION %IRSSI);
-$VERSION = "1.0.0";
+$VERSION = "1.1.0";
%IRSSI = (
authors => "Timo 'cras' Sirainen, Leszek Matok",
contact => "lam\@lac.pl",
name => "autorejoin",
- description => "Automatically rejoin to channel after being kick, after a (short) user-defined delay",
+ description => "Automatically rejoin to channel after being kicked, after a (short) user-defined delay",
license => "GPLv2",
changed => "10.3.2002 14:00"
);
-
-# How many seconds to wait before the rejoin?
-# TODO: make this a /setting
-my $delay = 5;
-
-my @tags;
-my $acttag = 0;
-
sub rejoin {
my ( $data ) = @_;
- my ( $tag, $servtag, $channel, $pass ) = split( / +/, $data );
+ my ( $servtag, $channel, $pass ) = @{$data};
my $server = Irssi::server_find_tag( $servtag );
$server->send_raw( "JOIN $channel $pass" ) if ( $server );
- Irssi::timeout_remove( $tags[$tag] );
}
sub event_rejoin_kick {
@@ -48,10 +42,31 @@ sub event_rejoin_kick {
my $rejoinchan = $chanrec->{ name } if ( $chanrec );
my $servtag = $server->{ tag };
- Irssi::print "Rejoining $rejoinchan in $delay seconds.";
- $tags[$acttag] = Irssi::timeout_add( $delay * 1000, "rejoin", "$acttag $servtag $rejoinchan $password" );
- $acttag++;
- $acttag = 0 if ( $acttag > 60 );
+ # check if we want to autorejoin this channel
+ my $chans = Irssi::settings_get_str( 'autorejoin_channels' );
+
+ if ( $chans ) {
+ my $found = 0;
+ foreach my $chan ( split( /[ ,]/, $chans ) ) {
+ if ( lc( $chan ) eq lc( $channel ) ) {
+ $found = 1;
+ last;
+ }
+ }
+ return unless $found;
+ }
+
+ my @args = ($servtag, $rejoinchan, $password);
+ my $delay = Irssi::settings_get_int( "autorejoin_delay" );
+
+ if ($delay) {
+ Irssi::print "Rejoining $rejoinchan in $delay seconds.";
+ Irssi::timeout_add_once( $delay * 1000, "rejoin", \@args );
+ } else {
+ rejoin( \@args );
+ }
}
+Irssi::settings_add_int('misc', 'autorejoin_delay', 5);
+Irssi::settings_add_str('misc', 'autorejoin_channels', '');
Irssi::signal_add( 'event kick', 'event_rejoin_kick' );
diff --git a/scripts/buf.pl b/scripts/buf.pl
index 6d907f12..0b37e9de 100644
--- a/scripts/buf.pl
+++ b/scripts/buf.pl
@@ -1,22 +1,24 @@
use strict;
use vars qw($VERSION %IRSSI);
+use Storable;
+use 5.014000;
use Irssi qw(command signal_add signal_add_first active_win
settings_get_str settings_get_bool channels windows
- settings_add_str settings_add_bool get_irssi_dir
- window_find_refnum signal_stop);
-$VERSION = '2.20';
+ settings_add_str settings_add_bool get_irssi_dir
+ window_find_refnum signal_stop);
+$VERSION = '3.00';
%IRSSI = (
- authors => 'Juerd',
- contact => 'juerd@juerd.nl',
- name => 'Scroll buffer restorer',
- description => 'Saves the buffer for /upgrade, so that no information is lost',
- license => 'Public Domain',
- url => 'http://juerd.nl/irssi/',
- changed => 'Thu Sep 22 01:37 CEST 2016',
- changes => 'Fixed file permissions (leaked everything via filesystem)',
- note1 => 'This script HAS TO BE in your scripts/autorun!',
- note2 => 'Perl support must be static or in startup',
+ authors => 'Juerd',
+ contact => 'juerd@juerd.nl',
+ name => 'Scroll buffer restorer',
+ description => 'Saves the buffer for /upgrade, so that no information is lost',
+ license => 'Public Domain',
+ url => 'http://juerd.nl/irssi/',
+ changed => 'Thu Mar 29 10:00 CEST 2018',
+ changes => 'Fixed file permissions (leaked everything via filesystem), rewritten to use Storable and print to correct levels',
+ note1 => 'This script HAS TO BE in your scripts/autorun!',
+ note2 => 'Perl support must be static or in startup',
);
# Q: How can I get a very smooth and clean upgrade?
@@ -40,30 +42,28 @@ my %suppress;
sub _filename { sprintf '%s/scrollbuffer', get_irssi_dir }
sub upgrade {
- my $fn = _filename;
- my $old_umask = umask 0077;
- open my $fh, q{>}, $fn or die "open $fn: $!";
- umask $old_umask;
-
- print $fh join("\0", map $_->{server}->{address} . $_->{name}, channels), "\n";
+ my $out = { suppress => [ map $_->{server}->{address} . $_->{name}, channels ] };
for my $window (windows) {
- next unless defined $window;
- next if $window->{name} eq 'status';
- my $view = $window->view;
- my $line = $view->get_lines;
- my $lines = 0;
- my $buf = '';
- if (defined $line){
- {
- $buf .= $line->get_text(1) . "\n";
- $line = $line->next;
- $lines++;
- redo if defined $line;
- }
- }
- printf $fh "%s:%s\n%s", $window->{refnum}, $lines, $buf;
+ next unless defined $window;
+ next if $window->{name} eq 'status';
+ my $view = $window->view;
+ my $line = $view->get_lines;
+ my $lines = 0;
+ my $buf = '';
+ my $output;
+ if (defined $line) {
+ {
+ push @$output, { level => $line->{info}{level}, data => $line->get_text(1) };
+ $line = $line->next;
+ redo if defined $line;
+ }
+ }
+ push @{$out->{windows}}, { refnum => $window->{refnum}, lines => $output };
}
- close $fh;
+ my $old_umask = umask 0077;
+ my $fn = _filename;
+ store($out, $fn) or die "Could not store data to $fn";
+ umask $old_umask;
unlink sprintf("%s/sessionconfig", get_irssi_dir);
command 'layout save';
command 'save';
@@ -71,33 +71,30 @@ sub upgrade {
sub restore {
my $fn = _filename;
- open my $fh, q{<}, $fn or die "open $fn: $!";
+ my $in = retrieve($fn) or die "Could not retrieve data from $fn";
unlink $fn or warn "unlink $fn: $!";
-
- my @suppress = split /\0/, readline $fh;
- if (settings_get_bool 'upgrade_suppress_join') {
- chomp $suppress[-1];
- @suppress{@suppress} = (2) x @suppress;
- }
+
+ my @suppress = @{$in->{suppress}};
+ @suppress{@suppress} = (2) x @suppress if (settings_get_bool 'upgrade_suppress_join');
+
active_win->command('^window scroll off');
- while (my $bla = readline $fh){
- chomp $bla;
- my ($refnum, $lines) = split /:/, $bla;
- next unless $lines;
- my $window = window_find_refnum $refnum;
- unless (defined $window){
- readline $fh for 1..$lines;
- next;
- }
- my $view = $window->view;
- $view->remove_all_lines();
- $view->redraw();
- my $buf = '';
- $buf .= readline $fh for 1..$lines;
- my $sep = settings_get_str 'upgrade_separator';
- $sep .= "\n" if $sep ne '';
- $window->gui_printtext_after(undef, MSGLEVEL_CLIENTNOTICE, "$buf\cO$sep");
- $view->redraw();
+ for my $win (@{$in->{windows}}) {
+ my $window = window_find_refnum $win->{refnum};
+ next unless $window;
+ my @lines = @{ $win->{lines} || [] };
+ next unless @lines;
+
+ my $view = $window->view;
+ $view->remove_all_lines();
+ $view->redraw();
+ for my $line (@lines) {
+ my $level = $line->{level};
+ my $data = $line->{data};
+ $window->gui_printtext_after($window->last_line_insert, $level, "$data\n");
+ }
+ my $sep = settings_get_str 'upgrade_separator';
+ $window->gui_printtext_after($window->last_line_insert, MSGLEVEL_CLIENTNOTICE, "\cO$sep\n") if $sep ne '';
+ $view->redraw();
}
active_win->command('^window scroll on');
active_win->command('^scrollback end');
@@ -110,7 +107,7 @@ sub suppress {
$key_part =~ s/^://;
my $key = $first->{address} . $key_part;
if (exists $suppress{$key} and $suppress{$key}--) {
- signal_stop();
+ signal_stop();
delete $suppress{$key} unless $suppress{$key};
}
}
diff --git a/scripts/dns.pl b/scripts/dns.pl
index 989cdc3e..9e9f4789 100644
--- a/scripts/dns.pl
+++ b/scripts/dns.pl
@@ -1,16 +1,18 @@
# /DNS || ...
-# version 2.1.1
-#
-# updated the script to fix a bug where the script would let
-# a trailing whitespace go through (ex: tab completion)
-# - inch
+#
+# v2.2
+# add ipv6 support
+# v2.1.1
+# updated the script to fix a bug where the script would let
+# a trailing whitespace go through (ex: tab completion)
+# - inch
use strict;
use Socket;
use POSIX;
use vars qw($VERSION %IRSSI);
-$VERSION = "2.1.1";
+$VERSION = "2.2";
%IRSSI = (
authors => "Timo \'cras\' Sirainen",
contact => "tss\@iki.fi",
@@ -18,7 +20,7 @@ $VERSION = "2.1.1";
description => "/DNS || ...",
license => "Public Domain",
url => "http://irssi.org/",
- changed => "2002-03-04T22:47+0100"
+ changed => "2019-01-24"
);
my (%resolve_hosts, %resolve_nicks, %resolve_print); # resolve queues
@@ -102,6 +104,42 @@ sub sig_userhost {
host_lookup() if (!$lookup_waiting);
}
+sub dns {
+ my ($host) =@_;
+ my %hints = (socktype => SOCK_STREAM);
+ my ($err, @res) = Socket::getaddrinfo($host, "http", \%hints);
+ my @res1;
+ if ($err ==0 ) {
+ foreach(@res) {
+ if ($_->{family}==AF_INET) {
+ my ($proto,$ip)=unpack_sockaddr_in($_->{addr});
+ push @res1, Socket::inet_ntop(AF_INET,$ip);
+ }
+ if ($_->{family}==AF_INET6) {
+ my ($proto,$ip)=unpack_sockaddr_in6($_->{addr});
+ push @res1, Socket::inet_ntop(AF_INET6,$ip);
+ }
+ }
+ return join(' ',@res1);
+ }
+}
+
+sub rdns {
+ my ($host) =@_;
+ my %hints = (socktype => SOCK_STREAM);
+ my ($err, @res) = Socket::getaddrinfo($host, "http", \%hints);
+ my @res1;
+ if ($err ==0 ) {
+ foreach(@res) {
+ my ($err, $hostname, $servicename) = Socket::getnameinfo $_->{addr};
+ if ($err ==0) {
+ push @res1, $hostname;
+ }
+ }
+ return join(' ',@res1);
+ }
+}
+
sub host_lookup {
return if (!%resolve_hosts);
@@ -145,16 +183,13 @@ sub host_lookup {
eval {
# child, do the lookup
my $name = "";
- if ($host =~ /^[0-9\.]*$/) {
+ if ($host =~ /^[0-9\.]*$/ || $host =~ m/^[0-9a-f:]*$/) {
# ip -> host
- $name = gethostbyaddr(inet_aton($host), AF_INET);
+ #$name = gethostbyaddr(inet_aton($host), AF_INET);
+ $name = rdns($host);
} else {
# host -> ip
- my @addrs = gethostbyname($host);
- if (@addrs) {
- @addrs = map { inet_ntoa($_) } @addrs[4 .. $#addrs];
- $name = join (" ", @addrs);
- }
+ $name = dns($host);
}
$print_name = $input_query if !$print_name;
@@ -197,3 +232,5 @@ Irssi::command_bind('dns', 'cmd_dns');
Irssi::signal_add( {
'redir dns failure' => \&sig_failure,
'redir dns host' => \&sig_userhost } );
+
+# vim:set sw=2 ts=8:
diff --git a/scripts/examples/Makefile.am b/scripts/examples/Makefile.am
deleted file mode 100644
index c8d8c8e0..00000000
--- a/scripts/examples/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-scriptdir = $(datadir)/irssi/scripts
-
-script_DATA = \
- command.pl \
- msg-event.pl \
- redirect.pl
-
-EXTRA_DIST = $(script_DATA)
diff --git a/scripts/mail.pl b/scripts/mail.pl
index 190c33af..bf14503a 100644
--- a/scripts/mail.pl
+++ b/scripts/mail.pl
@@ -1,11 +1,12 @@
use strict;
use vars qw($VERSION %IRSSI);
-$VERSION = "2.92";
+$VERSION = "2.93";
%IRSSI = (
authors => "Timo Sirainen, Matti Hiljanen, Joost Vunderink, Bart Matthaei",
contact => "tss\@iki.fi, matti\@hiljanen.com, joost\@carnique.nl, bart\@dreamflow.nl",
name => "mail",
description => "Fully customizable mail counter statusbar item with multiple mailbox and multiple Maildir support",
+ sbitems => "mail",
license => "Public Domain",
url => "http://irssi.org, http://scripts.irssi.de",
);
@@ -30,6 +31,7 @@ $VERSION = "2.92";
# Check /mailbox help for help.
use Irssi::TextUI;
+use Irssi;
my $maildirmode = 0; # maildir=1, file(spools)=0
my $old_is_not_new = 0;
@@ -37,7 +39,7 @@ my $extprog;
my ($last_refresh_time, $refresh_tag);
# for mbox caching
-my $last_size, $last_mtime, $last_mailcount, $last_mode;
+my ($last_size, $last_mtime, $last_mailcount, $last_mode);
# list of mailboxes
my %mailboxes = ();
@@ -61,8 +63,8 @@ sub cmd_print_help {
"/MAILBOX SHOW\n".
" - Shows a list of the defined mailboxes.\n\n".
"Use the following commands to change the behaviour:\n\n".
- "/SET MAILDIRMODE on|off\n".
- " - If maildirmode is on, the mailboxes in the list are assumed to be ".
+ "/SET MAILDIR_MODE on|off\n".
+ " - If maildir_mode is on, the mailboxes in the list are assumed to be ".
"directories. Otherwise they are assumed to be spool files.\n".
" Default: off.\n".
"/SET MAIL_OLDNOTNEW on|off\n".
@@ -101,8 +103,9 @@ sub mbox_count {
my $old_is_not_new=Irssi::settings_get_bool('mail_oldnotnew');
if ($extprog ne "") {
- $total = `$extprog`;
- chomp $unread;
+ my $total = `$extprog`;
+ chomp $total;
+ ($read, $unread) = split ' ', $total, 2;
} else {
if (!$maildirmode) {
if (-f $mailfile) {
@@ -115,8 +118,7 @@ sub mbox_count {
$last_size = $size;
$last_mtime = $mtime;
- my $f = gensym;
- return 0 if (!open($f, "<", $mailfile));
+ return 0 if (!open(my $f, "<", $mailfile));
# count new mails only
my $internal_removed = 0;
@@ -205,7 +207,7 @@ sub mail {
my $total = 0;
# check all mailboxes for new email
- foreach $name (keys(%mailboxes)) {
+ foreach my $name (keys(%mailboxes)) {
my $box = $mailboxes{$name};
# replace "~/" at the beginning by the user's home dir
$box =~ s/^~\//$ENV{'HOME'}\//;
@@ -233,7 +235,7 @@ sub mail {
# Show this only if there are any new, unread messages.
if (Irssi::settings_get_bool('mail_show_message') &&
$unread > $new_mails_in_box{$name}) {
- $new_mails = $unread - $new_mails_in_box{$name};
+ my $new_mails = $unread - $new_mails_in_box{$name};
if ($nummailboxes == 1) {
Irssi::print("You have $new_mails new message" . ($new_mails != 1 ? "s." : "."), MSGLEVEL_CRAP);
} else {
@@ -263,11 +265,9 @@ sub add_mailboxes {
my $boxstring = $_[0];
my @boxes = split(/,/, $boxstring);
- foreach $dbox(@boxes) {
- my $name = $dbox;
- $name = substr($dbox, 0, index($dbox, '='));
- my $box = $dbox;
- $box = substr($dbox, index($dbox, '=') + 1, length($dbox));
+ foreach my $dbox(@boxes) {
+ my $name = substr($dbox, 0, index($dbox, '='));
+ my $box = substr($dbox, index($dbox, '=') + 1, length($dbox));
addmailbox($name, $box);
}
}
@@ -306,7 +306,7 @@ sub delmailbox {
sub update_settings_string {
my $setting;
- foreach $name (keys(%mailboxes)) {
+ foreach my $name (keys(%mailboxes)) {
$setting .= $name . "=" . $mailboxes{$name} . ",";
}
@@ -345,7 +345,7 @@ sub cmd_showmailboxes {
return;
}
Irssi::print("Mailboxes:", MSGLEVEL_CRAP);
- foreach $box (keys(%mailboxes)) {
+ foreach my $box (keys(%mailboxes)) {
Irssi::print("$box: " . $mailboxes{$box}, MSGLEVEL_CRAP);
}
}
diff --git a/scripts/meson.build b/scripts/meson.build
new file mode 100644
index 00000000..10fdc34b
--- /dev/null
+++ b/scripts/meson.build
@@ -0,0 +1,15 @@
+install_data(
+ files(
+ 'autoop.pl',
+ 'autorejoin.pl',
+ 'buf.pl',
+ 'dns.pl',
+ 'kills.pl',
+ 'mail.pl',
+ 'mlock.pl',
+ 'quitmsg.pl',
+ 'scriptassist.pl',
+ 'usercount.pl',
+ ),
+ install_dir : scriptdir,
+)
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 459d97f6..665615db 100644
--- a/scripts/scriptassist.pl
+++ b/scripts/scriptassist.pl
@@ -5,30 +5,35 @@
use strict;
-our $VERSION = '2003020804';
+our $VERSION = '2023111700';
our %IRSSI = (
authors => 'Stefan \'tommie\' Tomanek',
contact => 'stefan@pico.ruhr.de',
name => 'scriptassist',
description => 'keeps your scripts on the cutting edge',
license => 'GPLv2',
- url => 'http://irssi.org/scripts/',
- modules => 'Data::Dumper LWP::UserAgent (GnuPG)',
+ url => 'https://scripts.irssi.org/',
+ modules => 'CPAN::Meta::YAML LWP::Protocol::https (GnuPG)',
commands => "scriptassist"
);
our ($forked, %remote_db, $have_gpg, @complist);
use Irssi 20020324;
-use Data::Dumper;
+use CPAN::Meta::YAML;
use LWP::UserAgent;
+use Hash::Util qw(lock_ref_keys);
+use JSON::PP;
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('v'.Irssi::parse_special('$J') =~ s/[^.\d].*//r);
+
sub show_help {
my $help = "scriptassist $VERSION
/scriptassist check
@@ -39,15 +44,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 scripts
+/scriptassist top
+ Retrieve the first top rated scripts
+/scriptassist new
Display the newest scripts
-".#/scriptassist rate )?\s*((\r?\n)*\s*\s*)?(\s*){0,3})}{\1\2}g;
+s{}{}g;
+s{(.*?)}{\1}g;'
+
+srcdir=`dirname "$0"`
+test -z "$srcdir" && srcdir=.
+srcdir="$srcdir"/..
+
+if test ! -f "$srcdir"/irssi.conf; then
+ echo -n "**Error**: Directory \`$srcdir' does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+fi
+
+# detect downloader app
+downloader=false
+
+if type curl >/dev/null 2>&1 ; then
+ downloader="curl -Ssf"
+elif type wget >/dev/null 2>&1 ; then
+ downloader="wget -nv -O-"
+else
+ echo "**Error**: No wget or curl present"
+ echo "Install wget or curl, then run syncdocs.sh again"
+fi
+
+# detect html converter app
+converter=false
+if [ "$1" = "-any" ]; then
+ any=true
+else
+ any=false
+fi
+
+addheadermark="perl -p -e s{\\K}{(q:#:x\$1).q: :}ge;s{(?= )}{q: :.(q:#:x\$1)}ge"
+if type w3m >/dev/null 2>&1 ; then
+ converter="w3m -o display_link_number=1 -dump -T text/html"
+ any=true
+elif type lynx >/dev/null 2>&1 ; then
+ converter="lynx -dump -stdin -force_html"
+elif type elinks >/dev/null 2>&1 ; then
+ converter="elinks -dump -force-html"
+else
+ echo "**Error**: Neither w3m, nor lynx or elinks present"
+ echo "Install w3m, then run syncdocs.sh again"
+ exit 1
+fi
+
+if ! $any ; then
+ echo "**Error**: w3m not present"
+ echo "If you want to use lynx or elinks, run syncdocs.sh -any"
+ exit 1
+fi
+
+check_download() {
+ if test "$1" -ne 0 || test ! -e "$2" || test "$(wc -l "$2" | awk '{print $1}')" -le 1 ; then
+ rm -f "$2"
+ echo "... download failed ( $1 )"
+ exit 2
+ fi
+}
+
+download_it() {
+ echo "Downloading $1 from $2 ..."
+ ret=0
+ $downloader "$2" > "$3".tmp || ret=$?
+ check_download "$ret" "$3".tmp
+ perl -i -0777 -p -e "$pageclean_regex" "$3".tmp
+ perl -i -0777 -p -e 's{\A}{'" "'\n}' "$3".tmp
+ perl -i -0777 -p -e 's{\[email protected\]}{user\@host}g' "$3".tmp
+ mv "$3".tmp "$3"
+}
+
+download_it_nested() {
+ name=$1; shift
+ src=$1; shift
+ dest=$1; shift
+ download_it "$name" "$src" "$dest".nest
+ echo > "$dest"
+ eval $(perl -n -0777 -e 'print qq{download_it "\$name ($2)" "\${src}$1/" "\${dest}.$1";
+cat "\${dest}.$1" >> "\${dest}.tmp";
+rm "\${dest}.$1";\n}
+ while(m{(.*?)}g)' "$dest".nest)
+ rm "$dest".nest
+ perl -i -0777 -p -e 's{ }{}g;s{\A}{ \n}' "$dest".tmp
+ mv "$dest".tmp "$dest"
+}
+
+download_it_nested "QNA" "$qna" "$srcdir"/docs/qna.html
+download_it "New users guide" "$howto" "$srcdir"/docs/New-users.html
+#download_it "Design" "$design" "$srcdir"/docs/design.html
+
+# .html -> .txt with lynx or elinks
+echo "Documentation: html -> txt... [converter: $converter]"
+
+cat "$srcdir"/docs/qna.html \
+ | $addheadermark | $converter > "$srcdir"/docs/qna.txt
+
+cat "$srcdir"/docs/New-users.html \
+ | $addheadermark | $converter > "$srcdir"/docs/New-users.txt
+
+#cat "$srcdir"/docs/design.html \
+# | $addheadermark | $converter > "$srcdir"/docs/design.txt
diff --git a/utils/syncscripts.sh b/utils/syncscripts.sh
new file mode 100755
index 00000000..5df1d036
--- /dev/null
+++ b/utils/syncscripts.sh
@@ -0,0 +1,39 @@
+#!/bin/sh -e
+# Run this script to sync dual lived scripts from scripts.irssi.org to scripts/
+
+PKG_NAME="Irssi"
+
+scriptbase=https://scripts.irssi.org/scripts
+
+srcdir=`dirname "$0"`
+test -z "$srcdir" && srcdir=.
+srcdir="$srcdir"/..
+
+if test ! -f "$srcdir"/irssi.conf; then
+ echo -n "**Error**: Directory \`$srcdir' does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+fi
+
+dl2='curl -Ssf'
+
+dl_it() {
+ echo "$1"
+ $dl2 -o "$srcdir/scripts/$1" "$scriptbase/$1"
+}
+
+for script in \
+ autoop.pl \
+ autorejoin.pl \
+ buf.pl \
+ dns.pl \
+ kills.pl \
+ mail.pl \
+ mlock.pl \
+ quitmsg.pl \
+ scriptassist.pl \
+ usercount.pl \
+ ;
+do
+ dl_it $script
+done
diff --git a/syntax.pl b/utils/syntax.pl
similarity index 98%
rename from syntax.pl
rename to utils/syntax.pl
index 33bd12b4..42a4accb 100755
--- a/syntax.pl
+++ b/utils/syntax.pl
@@ -39,6 +39,7 @@ foreach $file (@files) {
}
while () {
next if (/Makefile/);
+ next if (/meson\.build/);
open (FILE, "$_");
@data = ;