Compare commits

..

415 commits

Author SHA1 Message Date
ailin-nemui
43f1727ef9
Merge pull request #1611 from horgh/horgh/muon-meson-fmt-workflow
Add muon-meson fmt GitHub Actions workflow
2026-01-27 08:02:34 +00:00
William Storey
54bb34e14f Add muon fmt GitHub Actions workflow 2026-01-26 21:02:10 -08:00
William Storey
7ca9fd5aee Format root meson.build 2026-01-26 21:02:10 -08:00
Ailin Nemui
221d520c37 run meson formatter 2026-01-25 22:07:44 +01:00
ailin-nemui
80b8875fea
Merge pull request #1607 from ailin-nemui/gio-resolver-fixes
GResolver fixes
2026-01-25 18:22:20 +00:00
Ailin Nemui
88afc78aac GResolver fixes
fix issues brought up by @horgh in #1580
2026-01-25 00:25:44 +01:00
ailin-nemui
00466fe5be
Merge pull request #1605 from ailin-nemui/gio-resolver-old
add compatibility code for older GResolver
2026-01-24 20:04:17 +00:00
ailin-nemui
64db7abcec
Merge pull request #1606 from ailin-nemui/comment-warning
fix space in end comment
2026-01-24 20:03:33 +00:00
Ailin Nemui
0157a4424b fix clang-format-xs boot code 2026-01-24 20:53:29 +01:00
Ailin Nemui
00146211d0 fix space in end comment 2026-01-24 18:06:21 +01:00
Ailin Nemui
e9281b2f11 add compatibility code for older GResolver 2026-01-24 18:05:05 +01:00
ailin-nemui
3629a122c6
Merge pull request #1604 from ailin-nemui/perl-irc-dcc
make Irssi::Irc usable without dcc
2026-01-24 15:28:52 +00:00
Ailin Nemui
45d3013f9e up abi 2026-01-24 14:27:18 +01:00
Ailin Nemui
a54677ce99 up perl api 2026-01-24 14:27:16 +01:00
Ailin Nemui
2012668bef make Irssi::Irc usable without dcc 2026-01-24 14:27:16 +01:00
Ailin Nemui
51322d6af1 restore ip4_any 2026-01-24 13:53:23 +01:00
ailin-nemui
3c65684643
Merge pull request #1568 from nikolas/patch-2
Add a few more compile dependencies to INSTALL document
2026-01-23 21:18:17 +00:00
nikolas
c6d15ee461 Add a few more compile dependencies to INSTALL document 2026-01-23 22:17:39 +01:00
ailin-nemui
62031f5bdc
Merge pull request #1580 from ailin-nemui/gio-resolver
use GIO resolver
2026-01-23 20:42:55 +00:00
Ailin Nemui
e64ed836a5 up glib wrap 2026-01-23 21:21:10 +01:00
Ailin Nemui
51f2a4f7fb use GIO resolver
change: rename resolve_prefer_ipv6 -> irssiproxy_prefer_ipv6
2026-01-23 21:21:10 +01:00
ailin-nemui
d5be7d7756
Merge pull request #1578 from ailin-nemui/cygwin
make compilation work on cygwin
2026-01-23 20:20:43 +00:00
ailin-nemui
81887a6224
Merge pull request #1599 from ailin-nemui/docs
run syncdocs.sh
2025-12-27 21:46:58 +00:00
ailin-nemui
97304bb7c0
Merge pull request #1600 from ailin-nemui/github
github actions: update package lists
2025-12-27 21:46:19 +00:00
Ailin Nemui
d30cdafcff github actions: update package lists 2025-12-27 22:41:02 +01:00
Ailin Nemui
82b253f63e run syncdocs.sh
added New-users and qna, removed faq and startup-HOWTO from sync
2025-12-27 22:35:23 +01:00
ailin-nemui
ebdf863925
Merge pull request #1597 from ailin-nemui/scripts
run syncscripts.sh
2025-12-27 19:42:18 +00:00
Ailin Nemui
d145f24c22 run syncscripts.sh
autoop 1.10 -> 1.11
mail 2.92 -> 2.93
scriptassist 2022053100 -> 2023111700
2025-12-27 20:41:26 +01:00
ailin-nemui
6c72dc14fa
Merge pull request #1594 from soulseller/fix/hide-text-style-colors
formats: fix hide_text_style and hide_colors to mitigate color bleed
2025-11-27 11:16:35 +00:00
soulseller
3811b1ffc9 formats: fix hide_text_style and hide_colors to mitigate color bleed 2025-11-27 00:59:18 +02:00
ailin-nemui
89dc74cbdd
Merge pull request #1591 from soulseller/fix/netsplit-nickname-truncation
fe-netsplit: fix nickname truncation to avoid trailing comma-space
2025-11-25 13:19:12 +00:00
ailin-nemui
bab97b4c0c
Merge pull request #1588 from arza-zara/patch-1
Increase default scrollback_lines
2025-11-25 12:23:40 +00:00
soulseller
5416843d2d fe-netsplit: fix nickname truncation to avoid trailing comma-space 2025-11-23 15:15:24 +02:00
ailin-nemui
f4a4bcb4b8
Merge pull request #1590 from jremes-foss/lusers-in-typo-fix
Typo fix in docs/help/in/lusers.in
2025-11-22 15:08:00 +00:00
Juha Remes
3316202c48 Typo fix in docs/help/in/lusers.in 2025-11-22 14:27:53 +00:00
arza
f293277765
Increase default scrollback_lines
It seems common that people miss important messages when being away and want to increase the scrollback.
2025-09-23 00:01:54 +03:00
ailin-nemui
e70993c4b6
Merge pull request #1577 from ailin-nemui/glib276
replace str->str & g_string_free with g_string_free_and_steal
2025-07-26 17:32:43 +00:00
Ailin Nemui
989ddd8429 replace shared_module with shared_library
according to mesonbuild irc chat
2025-07-25 19:49:53 +02:00
Ailin Nemui
df8aa42778 make compilation work on cygwin 2025-07-25 16:20:28 +01:00
ailin-nemui
cc24b2c54c
Merge pull request #1579 from ailin-nemui/ghvoid
fix xbps github action
2025-07-25 14:48:09 +00:00
Ailin Nemui
d21ff2e658 fix xbps 2025-07-25 16:24:11 +02:00
Ailin Nemui
8eee36d1ea replace str->str & g_string_free with g_string_free_and_steal
solving unused warning in GLib 2.76
2025-07-22 12:03:49 +02:00
ailin-nemui
995e77c30d
Merge pull request #1575 from irssi/hilight_syntax_update
Add -priority to hilight syntax line
2025-07-21 16:51:55 +00:00
ailin-nemui
216715bc81
Merge pull request #1576 from ailin-nemui/solaris
fix github solaris test
2025-07-21 16:51:40 +00:00
Ailin Nemui
9f0b2bc50d detect third argument type of puts 2025-07-21 18:35:09 +02:00
Ailin Nemui
6276fe1a68 debug logging solarisvm prepare 2025-07-20 23:03:52 +02:00
Jari Matilainen
7681cb7585
Add -priority to hilight syntax line 2025-07-20 22:40:59 +02:00
ailin-nemui
aa285d45cd
Merge pull request #1572 from ailin-nemui/perl-redefined
fix _GNU_SOURCE redefined warning due to perl ccflags
2025-07-13 17:57:31 +00:00
Ailin Nemui
838f8d179e fix _GNU_SOURCE redefined warning due to perl ccflags 2025-07-13 19:33:52 +02:00
ailin-nemui
599448af2e
Merge pull request #1566 from ar-an-ribe/fix-for-issue-1513
Resolve issue #1513.
2025-05-02 05:56:26 +00:00
Christian Carey
f12ed4ff54 Resolve issue #1513. 2025-05-02 00:02:46 -04:00
ailin-nemui
4ec9d10904
Merge pull request #1560 from ailin-nemui/wchar
add missing include for wcwidth thread test
2025-04-29 20:34:42 +00:00
Ailin Nemui
9fd6df2a15 add missing include for wcwidth thread test 2025-04-29 22:27:14 +02:00
ailin-nemui
4b33824249
Merge pull request #1565 from ailin-nemui/void
Void Linux github action fixes
2025-04-29 20:26:31 +00:00
Ailin Nemui
8eea7bef92 curl render 2025-04-29 22:19:02 +02:00
Ailin Nemui
af4fa60d3e s/gsed/sed 2025-04-29 22:14:52 +02:00
ailin-nemui
824c1aa376
Merge pull request #1563 from ailin-nemui/void
test the void
2025-04-29 20:08:05 +00:00
Ailin Nemui
5c53f2a329 test the void 2025-04-29 22:03:33 +02:00
ailin-nemui
f857f29eaf
Merge pull request #1564 from ailin-nemui/pep440
adapt pep440 dev version in make-dist.sh
2025-04-29 20:02:49 +00:00
Ailin Nemui
4857586564 adapt pep440 dev version in make-dist.sh 2025-04-29 20:52:56 +02:00
ailin-nemui
b14bc4a2fc
Merge pull request #1559 from ailin-nemui/bitwarnings
make bitfields unsigned
2025-04-27 12:41:57 +00:00
Ailin Nemui
c7c8d074bd up abi 2025-04-27 14:31:53 +02:00
Ailin Nemui
8acda3f9eb make bitfields unsigned 2025-04-27 14:31:01 +02:00
ailin-nemui
39d15558d2
Merge pull request #1561 from ailin-nemui/ghactions
update to ubuntu 22.04 in github actions
2025-04-27 10:35:46 +00:00
Ailin Nemui
b9511a9b7e update to ubuntu 22.04 in github actions 2025-04-27 12:23:54 +02:00
ailin-nemui
4449455113
Merge pull request #1558 from ailin-nemui/darwin-warning
fe-text: remove const for better Darwin support
2025-04-14 17:23:36 +00:00
Emil Engler
32adf7c1dd fe-text: remove const for better Darwin support
This commit removes the `const` qualifier from certain member fields,
as the Darwin version of several `<term.h>` related functions only
accept a `char *` rather than a `const char *`, thereby resulting in
dozens of compiler warnings.
2025-04-14 18:16:04 +02:00
ailin-nemui
a5441f62b9
Merge pull request #1542 from sortie/HOST_NOT_FOUND
Fix using HOST_NOT_FOUND instead of EAI_NONAME.
2025-04-14 13:36:51 +00:00
ailin-nemui
a1c8edfa44
Merge pull request #1541 from sortie/inet_aton
Replace obsolescent inet_addr(3)/inet_aton(3) with inet_pton(3).
2025-04-14 13:36:44 +00:00
ailin-nemui
efd8f9b3a5
Merge pull request #1540 from sortie/select
Include <sys/select.h> to get select(3).
2025-04-14 13:36:35 +00:00
Jonas 'Sortie' Termansen
f24d859c80 Fix using HOST_NOT_FOUND instead of EAI_NONAME.
HOST_NOT_FOUND is a gethostbyname(3) error condition rather than a
getaddrinfo(3) error condition and cannot be passed to net_gethosterror
as documented as it calls gai_strerror(3). EAI_NONAME is the appropriate
similar error condition as standardized by POSIX for getaddrinfo(3).
2025-04-14 15:09:27 +02:00
Jonas 'Sortie' Termansen
38440cf340 Replace obsolescent inet_addr(3)/inet_aton(3) with inet_pton(3).
inet_addr has become obsolescent as of POSIX-1.2024 and is not available
on strict POSIX 2024 libc implementations.

inet_pton(3) is the standard and portable replacement available on all
POSIX-1.2001 systems.
2025-04-14 15:08:55 +02:00
Jonas 'Sortie' Termansen
4b2951c828 Include <sys/select.h> to get select(3).
This is the header required by POSIX-1.2024.

This change is needed to build irssi on operating systems such as Sortix
that have a strict libc without obsolete behaviors.
2025-04-14 15:08:02 +02:00
ailin-nemui
5a9a9ababa
Merge pull request #1557 from ailin-nemui/solarisvm
test solaris build with github/vmactions
2025-04-14 13:07:23 +00:00
Ailin Nemui
6dce0a091b test solaris build with vmactions 2025-04-08 09:03:10 +02:00
Ailin Nemui
382bde9ab3 namespace TERM_REC functions (conflict with curses.h) 2025-04-08 09:03:00 +02:00
Ailin Nemui
7bac5eb762 include curses.h when needed 2025-04-08 09:03:00 +02:00
ailin-nemui
fca3e83e68
Merge pull request #1543 from Steering7253/master
add ipaddr and family to perl SERVER_REC (and connrec)
2025-04-08 06:05:42 +00:00
ailin-nemui
23ec63ae39
Merge pull request #1556 from Steering7253/fix_sasl_multi_cap
fix irssi SASL negotiation with multiple CAP ACK
2025-04-07 20:37:18 +00:00
steering7253
99c37387a4
bump ABI_VERSION 2025-04-07 14:36:10 -06:00
ailin-nemui
85bb6ef008
Merge pull request #1552 from ailin-nemui/tv2
initialise memory in ctcp ping reply
2025-04-07 20:33:53 +00:00
steering7253
49d7302e98
fix irssi SASL negotiation with multiple CAP ACK
when attempting SASL, if multiple CAP ACK were received (for example,
because a script sent an additional CAP REQ), then any not containing
`sasl` would cause SASL to fail (immediately aborting the connection
with no message, depending on sasl_disconnect_on_failure setting)

check not only if SASL is set in this line, but also if we've already
seen it in a previous line.
2025-04-07 13:53:39 -06:00
steering7253
26fd0585cd
add ipaddr and family to connrec and perl SERVER_REC 2025-04-07 13:51:49 -06:00
Ailin Nemui
d6c146a1fa initialise memory in ctcp ping reply 2025-03-24 08:54:01 +01:00
ailin-nemui
ee4471a118
Merge pull request #1546 from ailin-nemui/setuptools
fix github workflow setuptools
2024-12-16 20:00:54 +00:00
Ailin Nemui
e8e5bf5d81 patch old setuptools for python 3.12 for github workflow 2024-12-16 20:57:44 +01:00
Ailin Nemui
a7bb40f530 pin setuptools and meson ver for make dist in workflow 2024-12-16 20:57:27 +01:00
Ailin Nemui
a775f50572 add glib dependency to github workflows 2024-12-16 20:57:27 +01:00
Ailin Nemui
ca1cd7a26a new setuptools broken in github workflow 2024-12-16 20:57:27 +01:00
ailin-nemui
344dd0fbd4
Merge pull request #1545 from plundra/plundra/actions-upload-fix
github workflows: Bump actions/upload-artifact from deprecated (defunct) v1 to v4.
2024-12-16 19:56:05 +00:00
Pontus Lundkvist
ae094ba3e6 Bump actions/upload-artifact from deprecated (defunct) v1 to v4. 2024-11-18 22:43:57 +01:00
ailin-nemui
0697e3eaf1
Merge pull request #1527 from ardovm/capsicumdoc
Mention the section for capsicum settings.
2024-05-13 20:11:09 +00:00
Arrigo Marchiori
2dce273264 Mention the section of the capsicum settings. 2024-04-27 21:38:21 +02:00
ailin-nemui
5c15937554
Merge pull request #1525 from ailin-nemui/bans
fix /ban command
2024-04-12 21:18:39 +00:00
Ailin Nemui
19e7d3f6b8 up abi 2024-04-12 23:00:52 +02:00
Ailin Nemui
822fd50132 fix /ban command 2024-04-12 22:55:20 +02:00
ailin-nemui
4b48cdce65
Merge pull request #1523 from irssi/from-codeberg
From codeberg
2024-04-02 06:29:49 +00:00
ailin-nemui
c906b769fd
Merge pull request #1522 from dwfreed/fix-missing-nl
Ensure all text files have newlines at the end
2024-04-02 06:27:24 +00:00
Doug Freed
9d0787fc10 Ensure all files have newlines at the end 2024-04-02 05:23:10 +00:00
ailin-nemui
89f3e1acf5
Merge pull request #1519 from ailin-nemui/openssl3
deprecated openssl3 function
2024-04-01 20:36:00 +00:00
ailin-nemui
7b56ffdc2e
Merge pull request #1518 from ailin-nemui/dylib
fix deprecation in new glib module_open
2024-04-01 20:35:05 +00:00
ailin-nemui
bb4ed2b14f
Merge pull request #1521 from ailin-nemui/nodejs
github actions nodejs churn
2024-04-01 20:33:21 +00:00
Ailin Nemui
455dcb18ec deprecated openssl3 function 2024-04-01 22:31:53 +02:00
Ailin Nemui
111e9160a9 github actions nodejs churn 2024-04-01 22:28:17 +02:00
ailin-nemui
d30653f7f9
Merge pull request #1520 from irssi/readme-perl-ver
Update minimum required Perl version in readme
2024-04-01 20:11:15 +00:00
ailin-nemui
c48354307e
Update minimum required Perl version in readme 2024-04-01 22:10:35 +02:00
Ailin Nemui
e13df83dc8 new code for g_module_open which might work with apple dylibs given new enough glib 2024-04-01 17:38:30 +02:00
ailin-nemui
b18832bf3b
Merge pull request #1500 from patrick-irc/scram
Added support for SCRAM-SHA-1, SCRAM-SHA-256 and SCRAM-SHA-512
2024-04-01 15:17:16 +00:00
Ailin Nemui
2f2fa029f9 up abi 2024-04-01 16:37:35 +02:00
Ailin Nemui
08bb648850 proper sasl mechanism variable initialisation 2024-04-01 16:33:57 +02:00
Ailin Nemui
98b391f62e minor cleanup 2024-04-01 16:33:36 +02:00
Patrick Okraku
f2b97631e1 Added support for SCRAM-SHA-1, SCRAM-SHA-256 and SCRAM-SHA-512 2024-04-01 15:12:01 +02:00
ailin-nemui
215be29035 Merge pull request 'Fix github issue #1504 - irssi switches to af_unix if network name contains /' (!6) from ticho/irssi:gh1504 into master
Reviewed-on: https://codeberg.org/irssi/irssi/pulls/6
2024-04-01 08:42:17 +00:00
Andrej Kacian
e295caa866 Fix github issue #1504 - irssi switches to af_unix if network name contains /
In addition to looking for a /, we also check if the network name is
known.
2024-04-01 08:42:17 +00:00
ailin-nemui
91dac0e5a1
Merge pull request #1512 from ailin-nemui/shquote
missing shell quotes
2024-03-31 16:53:57 +00:00
ailin-nemui
aebc0667a6
Merge pull request #1515 from maflcko/patch-1
Update server.c: Add missing include
2024-03-31 16:53:44 +00:00
maflcko
cf6615a70e
Update server.c: Add missing include 2024-03-28 19:33:24 +01:00
Ailin Nemui
4dd57cf24e missing shell quotes 2024-02-23 17:04:41 +01:00
ailin-nemui
b3f6ed0b11
Merge pull request #1511 from soliton-/patch-1
typo fixes
2024-02-01 21:24:30 +00:00
Gunter Labes
41f8213fe0
typo fixes 2024-02-01 21:56:20 +01:00
ailin-nemui
504fd7bc60
Merge pull request #1510 from ailin-nemui/perl-again
restore locale if perl breaks it
2024-01-27 17:42:42 +00:00
Ailin Nemui
a0caf5e5e6 restore locale if perl breaks it 2023-12-22 15:06:23 +01:00
Ailin Nemui
514f1cdcf6 Revert "Merge pull request #1498 from ailin-nemui/perl5380locale"
This reverts commit 48bc90eb17, reversing
changes made to 2a1291f26f.
2023-12-22 15:06:23 +01:00
ailin-nemui
2f16b554b5
Merge pull request #1509 from ailin-nemui/compile-deps
explicitly list pkg-config as build dependency
2023-12-19 12:53:20 +00:00
Ailin Nemui
a11df816b7 explicitly list pkg-config as build dependency, since meson needs it to find glib 2023-12-19 13:51:46 +01:00
ailin-nemui
89adcc4ee8
Merge pull request #1505 from irssi/vague666-patch-1
Update bind.in
2023-11-11 13:55:37 +00:00
Jari Matilainen
ed2825f28b
Update bind.in
Better explanation for upper-/lowercase usage for keys
2023-11-11 02:13:34 +01:00
ailin-nemui
363fbf048f
Merge pull request #1502 from irssi/ailin-nemui/window-default-help
Add SET window_default_ to See also in window help
2023-10-31 10:00:46 +00:00
ailin-nemui
ea434591f4
Add SET window_default_ to See also in window help 2023-10-31 10:58:14 +01:00
Ailin Nemui
465d3188a4 Merge tag '1.4.5' into integrate/1.4.5 2023-10-01 19:19:33 +02:00
ailin-nemui
48bc90eb17
Merge pull request #1498 from ailin-nemui/perl5380locale
Restore locale after loading Perl
2023-10-01 11:31:07 +00:00
Ailin Nemui
dfca0a9f84 Restore locale after loading Perl 2023-09-22 14:59:22 +02:00
ailin-nemui
2a1291f26f
Merge pull request #1497 from ailin-nemui/github-workflow-error
Slightly improve GitHub workflow
2023-09-14 13:32:44 +00:00
Ailin Nemui
7c5b2db269 add separate annotation-warnings step
see 2908d82845/src/Runner.Worker/Handlers/OutputManager.cs (L320)
see https://github.com/actions/runner/issues/763#issuecomment-1435735340
2023-09-14 15:24:19 +02:00
ailin-nemui
db32744ee4
Merge pull request #1495 from ailin-nemui/terminclude
fe-text: include the real tputs(3) from term.h
2023-09-13 20:55:21 +00:00
Ailin Nemui
4bc354d5e4 load all modules in the right order during check 2023-09-13 22:54:46 +02:00
Ailin Nemui
8c2fa0687e silence clang perl warning on affected version 2023-09-13 22:51:29 +02:00
Emil Engler
4ceafbeea4 fe-text: include the real tputs(3) from term.h
This commit includes the real `tpus(3)` function from the appropriate
`term.h` header file, if found.

This commit is necessary to fix a compiler warning on Darwin.
2023-09-12 17:20:21 +02:00
ailin-nemui
f04375668c
Merge pull request #1488 from emilengler/remove-unused-var
core: remove unused len variable
2023-09-12 14:53:59 +00:00
Ailin Nemui
fe6013be42 improve code formatting 2023-09-12 13:51:36 +02:00
ailin-nemui
f1c9fb4296
Merge pull request #1493 from ailin-nemui/macsuffix
add explicit name_suffix to shared modules
2023-09-12 11:27:03 +00:00
ailin-nemui
e7f1268478
Merge pull request #1494 from RealKindOne/master
Add -notls and -notls_verify into help file and src/core/chat-commands.c
2023-09-09 11:00:37 +00:00
KindOne
9ab78d0160 Add -notls and -notls_verify into help file and src/core/chat-commands.c 2023-09-09 05:25:30 -04:00
ailin-nemui
8c8e4e34d4
Merge pull request #1492 from ailin-nemui/meson-apple
document meson apple workaround
2023-09-06 14:04:20 +00:00
Ailin Nemui
523a42e6f0 document meson apple workaround
workaround for https://github.com/mesonbuild/meson/issues/11165
2023-09-04 21:42:18 +02:00
ailin-nemui
58ca3af360
Merge pull request #1491 from ailin-nemui/serveradd-crash
stop crash on server add
2023-08-26 17:11:38 +00:00
Ailin Nemui
a037f68f02 stop crash on server add
reported by nsprra
2023-08-22 22:28:36 +02:00
ailin-nemui
07b971cf0c
Merge pull request #1486 from vague666/edit_command_history
patch by petteri_ to enable bash-like editing of window history
2023-08-18 13:57:14 +00:00
Emil Engler
3aa9734c1c
core: remove unused len variable
This commit removes the unused `len` variable, which gets set quite a
few times, but whose value is totally unused.

This also fixes a compiler warning I get on my Darwin.
2023-08-14 12:01:31 +02:00
vague666
96dbcef166 patch by petteri_ to enable bash-like editing of window history 2023-08-14 11:35:06 +02:00
Ailin Nemui
c0db0b8cb8 add explicit name_suffix to shared modules 2023-08-10 10:19:01 +02:00
ailin-nemui
f9c9485d15
Merge pull request #1484 from ailin-nemui/realposix
change realpath to use syntax based on _POSIX_VERSION
2023-08-09 18:52:16 +00:00
Ailin Nemui
1131a881cf change realpath to use syntax based on _POSIX_VERSION 2023-08-08 07:59:31 +02:00
ailin-nemui
3f203dc382
Merge pull request #1478 from ailin-nemui/buildperl
update perl requirement in install file
2023-07-19 18:26:45 +00:00
Ailin Nemui
c93c61bf99 update perl requirement in install file 2023-07-19 20:04:25 +02:00
ailin-nemui
da49ec62e6
Merge pull request #1474 from ailin-nemui/perl5380
fix usage of $type in ExtUtils::ParseXS 3.50
2023-07-18 22:05:28 +00:00
Ailin Nemui
3ec05851a0 fix usage of $type in ExtUtils::ParseXS 3.50 2023-07-04 12:33:01 +02:00
ailin-nemui
274977a587
Merge pull request #1471 from irssi/from-codeberg
Sync
2023-05-25 11:00:40 +00:00
ailin-nemui
83ebc0a0e3
Merge pull request #1457 from examknow/listmode-timestamps
properly format listmodes and their timestamps
2023-05-25 11:00:32 +00:00
Ailin Nemui
685816e945 up abi 2023-05-25 11:48:31 +02:00
Ailin Nemui
0355ed0bea format 2023-05-25 11:42:15 +02:00
Ailin Nemui
0bcff291e9 order 2023-05-25 11:36:25 +02:00
ailin-nemui
ffe4dbac67 Merge pull request 'Fix logic in how own actions are printed for other protocols' (!5) from ticho/irssi:nonirc-own-action-print-fix into master
Reviewed-on: https://codeberg.org/irssi/irssi/pulls/5
2023-05-05 11:33:59 +00:00
Andrej Kacian
9e9858638d Fix logic in how own actions are printed for other protocols
When working with channels belonging to other, non-IRC protocols,
calling irc_channel_find() returns NULL, which makes irssi
use IRCTXT_OWN_ACTION_TARGET format, instead of the correct
IRCTXT_OWN_ACTION.

Using generic channel_find() instead fixes the issue.
2023-05-04 23:10:27 +02:00
ailin-nemui
e732b601f7
Merge pull request #1467 from ScoreUnder/perl_warning_to_stderr
Print perl import warning to STDERR
2023-04-15 14:08:31 +00:00
Score_Under
c5df1c01cc
Print perl import warning to STDERR
Printing to STDOUT can interfere with programs which intend to produce
machine-readable output and yet for whatever reason import Irssi.pm from
outside of irssi.

Closes https://github.com/irssi/irssi/issues/1465
2023-04-15 00:39:38 +01:00
ailin-nemui
a8a2460531
Merge pull request #1463 from ailin-nemui/github-ubuntu
update github workflows ubuntu
2023-04-04 13:29:32 +00:00
Ailin Nemui
a93c51796d update github workflows ubuntu 2023-04-04 15:18:54 +02:00
ailin-nemui
5c42345ea2
Merge pull request #1462 from mauke/upgrade-tilde-expand
expand ~ to $HOME in /upgrade
2023-04-04 13:12:50 +00:00
Lukas Mai
ca148a0122 expand ~ to $HOME in /upgrade
Fixes #1460.
2023-04-04 11:24:18 +02:00
ailin-nemui
c6ad171fe9
Merge pull request #1458 from ailin-nemui/help-toglev
update level toggle help
2023-03-31 12:43:36 +00:00
Ailin Nemui
960d185b42 update level toggle help 2023-03-31 14:42:50 +02:00
Ailin Nemui
152468efd0 Merge tag '1.4.4' into integrate/1.4.4 2023-03-31 04:24:56 +08:00
David Schultz
ee12134812
clean up time_ago()
Co-authored-by: Doug Freed <dwfreed@mtu.edu>
2023-03-27 19:37:48 -05:00
David Schultz
201296a0da add time_ago() in addition to timestamps; deduplicate qlist logic 2023-03-27 18:21:36 -05:00
ailin-nemui
c03057f36a
Merge pull request #1456 from ailin-nemui/collector
fix stale special collector use after free
2023-03-27 20:46:56 +00:00
ailin-nemui
d627e56021
Merge pull request #1450 from ailin-nemui/fix-1449
fix crash on connect in startup
2023-03-27 20:46:41 +00:00
David Schultz
9324ff9f68 this should work for everyone 2023-03-27 11:05:40 -05:00
David Schultz
556f580f67 add support for ircd-hybrid quiet lists 2023-03-26 19:27:48 -05:00
Ailin Nemui
c554a45738 fix stale special collector use after free
reported by ednash and investigated by @dwfreed
2023-03-26 23:37:12 +02:00
David Schultz
2db9dfbb46 properly format listmodes and their timestamps 2023-03-26 16:36:27 -05:00
ailin-nemui
6671fec9a9
Merge pull request #1455 from irssi/vague666-typo-fix
Update ignore.in
2023-03-21 08:49:09 +00:00
Jari Matilainen
5153bb3ff5
Update ignore.in
Fix typo
2023-03-21 09:44:01 +01:00
ailin-nemui
2b91c45f5d
Merge pull request #1454 from irssi/from-codeberg
Sync
2023-03-21 07:05:33 +00:00
ailin-nemui
bdec87e208 Merge pull request 'Fix logic in how actions are printed for other protocols' (!3) from ticho/irssi:nonirc-action-print-fix into master
Reviewed-on: https://codeberg.org/irssi/irssi/pulls/3
2023-03-21 06:25:57 +00:00
Andrej Kacian
3057c9e920 Fix logic in how actions are printed for other protocols
This causes subsequent window_item_set_active() check, further
down in the same function, to evaluate correctly, and getting
the action message printed using correct format.
2023-03-21 06:25:57 +00:00
ailin-nemui
1c9990acab
Merge pull request #1452 from irssi/vague666-levels-in-update
Update levels.in
2023-03-20 19:31:56 +00:00
ailin-nemui
706b6fff81
Merge pull request #1453 from irssi/vague666-ignore-in-update
Update ignore.in
2023-03-20 19:31:40 +00:00
Jari Matilainen
82bfd3abfe
Update ignore.in
Add NOHILIGHT description to help
2023-03-20 11:04:39 +01:00
Jari Matilainen
0334de0a05
Update levels.in
Make it more clear what NOHILIGHT can be used for
2023-03-20 11:00:37 +01:00
Ailin Nemui
7d3640ce2e fix crash on connect in startup
fixes #1449

does not completely fix the issue (connect still does not work, error message is misleading)
2023-02-25 20:44:12 +01:00
ailin-nemui
c1fd4b17f5
Merge pull request #1447 from ailin-nemui/signalsfile-fix
fix signalsfile some more
2023-02-13 08:51:33 +00:00
Ailin Nemui
25273898bf still didn't work 2023-02-12 16:31:23 +01:00
ailin-nemui
2ac1f01b94
Merge pull request #1446 from ailin-nemui/signalsfile-fix
fix signals file
2023-02-12 13:51:44 +00:00
Ailin Nemui
fcbe19eb8c fix signals file 2023-02-12 10:35:12 +01:00
ailin-nemui
72df66524b
Merge pull request #1445 from jesopo/ipv6-default
switch to prefering ipv6 by default
2023-02-09 17:41:11 +00:00
jesopo
9a29bf1022 switch to prefering ipv6 by default 2023-02-09 17:18:52 +00:00
ailin-nemui
c06be88d8f
Merge pull request #1442 from lheckemann/master
Support receiving monospace
2023-02-02 17:03:53 +01:00
Linus Heckemann
b91a56c2cd Support receiving monospace
0x11 (decimal 17) is used to denote monospace by a number of clients
according to https://modern.ircdocs.horse/formatting.html
2023-01-28 19:31:14 +01:00
ailin-nemui
3fb147ec72
Merge pull request #1441 from ailin-nemui/gh-actions
chores: update for github workflows deprecations
2023-01-22 16:49:20 +01:00
Ailin Nemui
274868d560 chores: update for github workflows deprecations 2023-01-22 16:39:05 +01:00
ailin-nemui
de43e9e067
Merge pull request #1439 from irssi/from-codeberg
Sync
2023-01-21 16:48:36 +01:00
ailin-nemui
fe8f2a5dc8
Merge pull request #1440 from ailin-nemui/termux-git
update termux package to git+
2023-01-21 16:44:18 +01:00
ailin-nemui
6bab6e2c06
update termux package to git+
20bd0f0dc0
2023-01-21 16:38:40 +01:00
ailin-nemui
251522685d Merge pull request 'Expose location of signals.txt via pkg-config' (!1) from ticho/irssi:signalsfile into master
Reviewed-on: https://codeberg.org/irssi/irssi/pulls/1
2023-01-19 21:50:41 +00:00
Andrej Kacian
c65bf6899f Expose location of signals.txt via pkg-config
Adds "signalsfile" variable to installed irssi-1.pc.
2023-01-19 22:41:51 +01:00
ailin-nemui
162dc256be
Merge pull request #1438 from qoreQyaS/master
Lang-Fix: Use more general messages
2022-12-25 17:51:32 +01:00
Sven "qoreQyaS" Grewe
f852cc4eb3 Lang-Fix: Use more general messages
* Changed the messages for /window level and /window immortal to a more
  general tone.
  Executing both commands without parameter show the current state but
  the old messages indicate a change of state.

Signed-off-by: Sven "qoreQyaS" Grewe <git@gucke.net>
2022-12-25 16:09:27 +01:00
ailin-nemui
6f5026fd49
Merge pull request #1432 from horgh/horgh/win-logfile
Check window logfile parameter
2022-12-23 10:34:56 +01:00
Will Storey
3415718ea7 Check a logfile parameter is given
Previously this continued with an empty filename, resulting in a broken
config file.

Fixes #1392.
2022-12-23 10:01:51 +01:00
Will Storey
6dfcde5acd Fix indentation issues in fe-log.c 2022-12-23 10:01:51 +01:00
ailin-nemui
8eca391b74
Merge pull request #1430 from ailin-nemui/config-lol
add list_of_lists to config and more error messages
2022-12-23 09:59:51 +01:00
ailin-nemui
7445ad1f15
Merge pull request #1434 from irssi/ailin-nemui/statusbar-help
correct statusbar help text
2022-12-18 21:53:34 +01:00
ailin-nemui
a83f94484c
correct statusbar help text 2022-12-18 21:53:27 +01:00
Ailin Nemui
19be330489 up abi 2022-12-18 21:11:54 +01:00
Ailin Nemui
e7fb82db89 update glib version to fix timezone assertion bug 2022-12-18 20:00:29 +01:00
Ailin Nemui
1453f46fcf add timezone to g_date_time_new_from_iso8601 call 2022-12-18 16:34:15 +01:00
ailin-nemui
f8500320cf
Merge pull request #1431 from ailin-nemui/missing-news
add missing news reference
2022-12-18 12:27:29 +01:00
Ailin Nemui
7f4bf738a3 add missing news reference 2022-12-18 12:27:00 +01:00
Ailin Nemui
8d7449d26f add list_of_lists to config and more error messages 2022-12-18 12:20:07 +01:00
ailin-nemui
b988b2925b
Merge pull request #1421 from j1mmie/patch-1
Add parameter LIST to STATUSBAR documentation
2022-12-18 12:18:13 +01:00
Jimmie Tyrrell
41071247f2 Add parameter LIST to STATUSBAR documentation
This command was not outlined in the documentation. `/STATUSBAR LIST` is an integral part of statusbar management and should be included.
2022-12-18 12:17:26 +01:00
ailin-nemui
42f83fc130
Merge pull request #1429 from ailin-nemui/docs-revamp
remove ported sections from manual and add links
2022-12-18 12:14:22 +01:00
Ailin Nemui
119d3203e1 remove ported sections from manual and add links 2022-12-18 12:13:38 +01:00
ailin-nemui
88cc48651d
Merge pull request #1428 from ailin-nemui/flip-level
add (hide)level flip command
2022-11-29 20:05:52 +01:00
Ailin Nemui
261a7ce76e add (hide)level flip command 2022-11-27 17:14:19 +01:00
ailin-nemui
6e3745f423
Merge pull request #1424 from ailin-nemui/lastlog
fix lastlog -window
2022-11-26 15:09:50 +01:00
Ailin Nemui
7d20ea92ae fix lastlog -window 2022-11-13 11:35:41 +01:00
Ailin Nemui
684094aa85 Merge tag '1.4.3' into integrate/1.4.3 2022-10-29 12:22:58 +02:00
ailin-nemui
afba148056
Merge pull request #1420 from ailin-nemui/starttls-config
enable saving of -disallow_starttls
2022-10-15 08:52:40 +02:00
ailin-nemui
a661e2fb35
Merge pull request #1419 from ailin-nemui/init-irc-funcs
move irc server functions to object creation time
2022-10-15 08:52:32 +02:00
ailin-nemui
0c97433c7c
Merge pull request #1417 from ailin-nemui/loop
do not freeze on alt+left/right
2022-10-15 08:52:20 +02:00
Ailin Nemui
833f41179d enable saving of -disallow_starttls 2022-10-14 21:37:09 +02:00
Ailin Nemui
c2457c7d94 move irc server functions to object creation time 2022-10-14 21:06:51 +02:00
Ailin Nemui
093dcd423f no infinite loops please 2022-09-22 22:25:02 +02:00
ailin-nemui
55913ade13
Merge pull request #1414 from irssi/vague666-patch-4
Add -nocap to /connect and /server connect syntax
2022-09-14 09:24:35 +02:00
ailin-nemui
de2bf6707f fix clang-format 2022-09-14 09:19:18 +02:00
ailin-nemui
238d7cfd08
Merge pull request #1413 from irssi/vague666-patch-3
Update /server syntax line
2022-09-13 09:52:30 +02:00
ailin-nemui
f76d41953f
Merge pull request #1415 from irssi/vague666-patch-5
/server: Add help for -cap/-nocap
2022-09-13 09:51:57 +02:00
ailin-nemui
38b18bd84d
Merge pull request #1411 from irssi/vague666-patch-1
/connect: Add help for -nocap
2022-09-13 09:51:43 +02:00
Jari Matilainen
d448ca3341
/server: Add help for -cap/-nocap 2022-09-12 14:17:34 +02:00
Jari Matilainen
07041c37d4
Add -nocap to /connect and /server connect syntax 2022-09-12 14:15:11 +02:00
Jari Matilainen
fe77b7e06f
Update /server syntax line 2022-09-12 14:07:05 +02:00
Jari Matilainen
03edebd54c
/connect: Add help for -nocap 2022-09-12 14:03:21 +02:00
ailin-nemui
f32d0ab51a
Merge pull request #1407 from madpilot78/Fix_libnv_detection
Fix libnv detection on recent FreeBSD
2022-08-19 10:42:05 +02:00
Guido Falsi
7baefc3315 Fix libnv detection on recent FreeBSD
On recent FreeBSD systems it is required to include the sys/nv.h file, otherwise symbols are missing.

Reported here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265397

Patch suggested by: Kristof Provost <kp@freebsd.org>
2022-08-19 10:32:47 +02:00
ailin-nemui
58109aeeed
Merge pull request #1403 from lnde/fetext-sigterm
Re-write SIGTERM handling
2022-08-12 12:17:49 +02:00
Andreas Lundin
a237321b33 re-write SIGTERM handling
Exit safely on SIGTERM by emitting "gui exit" from the main loops of
fe-text and fe-none rather than from the signal handler itself.

Based on feedback from Nei and dwfreed.
2022-08-11 20:09:59 +00:00
ailin-nemui
555030a2ad
Merge pull request #1405 from ailin-nemui/no-chatnet-crash
fix crash when loading server without chatnet
2022-08-08 22:20:19 +02:00
Ailin Nemui
252656cad4 fix crash when loading server without chatnet 2022-07-24 19:32:47 +02:00
Ailin Nemui
722d3c4c3d Merge tag '1.4.2' into integrate/1.4.2 2022-07-13 20:33:59 +02:00
ailin-nemui
a57cc1c55e
Merge pull request #1398 from ailin-nemui/lastlog-crash
get line texts before printing lastlog
2022-07-13 19:10:50 +02:00
Ailin Nemui
7fe7de3c2e get line texts before printing lastlog 2022-07-12 20:50:01 +02:00
ailin-nemui
5b0f7f7899
Merge pull request #1394 from ailin-nemui/faster-termux-pkg
use less time on termux pkg
2022-07-02 16:09:05 +02:00
Ailin Nemui
3fec4d894f use less time on termux pkg
hard-code the values instead of building perl
2022-07-02 14:12:15 +02:00
ailin-nemui
0bf18beed7
Merge pull request #1393 from ailin-nemui/eval-help
minor rendering fix in eval help
2022-06-30 23:25:35 +02:00
Ailin Nemui
f135339e27 minor rendering fix in eval help 2022-06-30 23:13:48 +02:00
ailin-nemui
593afc2e40
Merge pull request #1384 from ailin-nemui/meson-system-includes
use -isystem instead of -I for include directories
2022-06-18 12:43:01 +02:00
ailin-nemui
783dd37533
Merge pull request #1387 from ailin-nemui/textbufferview
Textbufferview
2022-06-18 12:42:47 +02:00
Ailin Nemui
4dc3eb1048 update clang-format 2022-06-13 09:41:46 +02:00
Ailin Nemui
453e65bbfe misc cleanup 2022-06-13 09:41:46 +02:00
Ailin Nemui
b028b8e19d fix recount of lines after scroll 2022-06-13 09:41:46 +02:00
Ailin Nemui
48edd6f5fa fix recount of lines after window set 2022-06-13 08:22:18 +02:00
ailin-nemui
a5f5ea7d79
Merge pull request #1388 from ailin-nemui/default-hash-chan
default to hash channels
2022-06-13 07:39:29 +02:00
Ailin Nemui
891ef5df10 default to hash channels 2022-06-13 02:44:33 +02:00
Ailin Nemui
04b914dcb0 fix visible lines expiring from cache 2022-06-13 01:17:19 +02:00
Ailin Nemui
67aa2baf62 fix memory leak when updating single line 2022-06-13 01:17:19 +02:00
Ailin Nemui
ae8ec99d5c fix scrollback redraw not updating linecount 2022-06-13 01:17:19 +02:00
ailin-nemui
68823eb6af
Merge pull request #1380 from ailin-nemui/scriptassist
run syncscripts.sh
2022-06-12 18:11:05 +02:00
ailin-nemui
545d97f8d6
Merge pull request #1383 from ailin-nemui/pc-moduledir
add irssimoduledir to irssi-1.pc
2022-06-12 18:10:50 +02:00
Ailin Nemui
279fa4e5b8 remove relevant code from termux receipe 2022-06-12 17:18:53 +02:00
Ailin Nemui
528632bba2 use -isystem instead of -I for include directories
limits warnings to our own code
2022-06-12 17:13:28 +02:00
Ailin Nemui
34d45ac678 add irssimoduledir to irssi-1.pc
for module authors to know where to install to
2022-06-12 16:52:31 +02:00
Ailin Nemui
88745d2941 run syncscripts.sh 2022-06-12 12:34:33 +02:00
ailin-nemui
07aa061b6d
Merge pull request #1377 from ailin-nemui/meson
fix yet another meson regression
2022-06-12 05:33:41 +02:00
Ailin Nemui
ac35fe010e fix yet another meson regression
broken by meson 0.60.0
2022-06-11 22:58:56 +02:00
Ailin Nemui
de46fee864 update website 2022-06-11 18:10:29 +02:00
Ailin Nemui
f2c5e60766 revert branding 2022-06-07 15:47:49 +02:00
Ailin Nemui
531c68ed09 Merge tag '1.4.1' into integrate/1.4.1 2022-06-06 21:11:30 +02:00
ailin-nemui
47b0661e96
Merge pull request #88 from ailin-nemui/arraycopy
fix missing len in g_array_copy
2022-06-01 18:38:15 +02:00
Ailin Nemui
a39bc0601c fix missing len in g_array_copy 2022-05-31 21:09:39 +02:00
Ailin Nemui
c33d0c2384 Merge tag '1.4.0-an' into integrate/1.4.0-an 2022-05-31 12:34:27 +02:00
ailin-nemui
af5feb16be
Merge pull request #84 from ailin-nemui/ignore-leak
avoid memory leak in ignore cache
2022-05-26 00:20:13 +02:00
Ailin Nemui
66e3b0e578 avoid memory leak in ignore cache
#1373
2022-05-22 11:06:53 +02:00
ailin-nemui
7285da27e0
Merge pull request #87 from ailin-nemui/names
stop IRC names when using /names
2022-05-22 11:00:02 +02:00
Ailin Nemui
5b340d7d2b stop IRC names when using /names 2022-05-19 14:54:15 +02:00
Ailin Nemui
9f71a391c3 test OBS workflow 2022-05-19 14:37:59 +02:00
Ailin Nemui
fb5c99d27f Merge remote-tracking branch 'irssi/master' 2022-04-25 23:33:58 +02:00
ailin-nemui
4cec2d98c5
Merge pull request #83 from ailin-nemui/shelp
new SHELP default alias
2022-04-24 15:40:54 +02:00
Ailin Nemui
37e65ba168 new SHELP default alias 2022-04-24 15:40:20 +02:00
ailin-nemui
b446d06b9d
Merge pull request #82 from ailin-nemui/progval-help
Format RPL_HELPSTART/RPL_HELPTXT/RPL_ENDOFHELP
2022-04-21 23:02:17 +02:00
Ailin Nemui
49479f151c up abi 2022-04-21 22:18:33 +02:00
Ailin Nemui
4f1e5f35a3 fix formatting 2022-04-21 22:00:18 +02:00
Ailin Nemui
ba16d71e9f add SERVER_ to constants 2022-04-21 22:00:18 +02:00
Valentin Lorentz
f684c18867 s/irctxt_/server_/ 2022-04-21 22:00:18 +02:00
Valentin Lorentz
48571389c7 Revert "Add ERR_HELPNOTFOUND"
This reverts commit 91439c099e1bbf848dac03f67a3239fcc4c1f771;
because it adds handling for numeric 524, which conflicts with
ERR_QUARANTINED and ERR_OPERSPVERIFY.
2022-04-21 22:00:18 +02:00
Valentin Lorentz
41b3895ce3 Free signals 2022-04-21 22:00:18 +02:00
Valentin Lorentz
1415ef5389 Add ERR_HELPNOTFOUND 2022-04-21 22:00:18 +02:00
Valentin Lorentz
3a3301e19b Format RPL_HELPSTART/RPL_HELPTXT/RPL_ENDOFHELP
They are typical replies when using the HELP command.
2022-04-21 22:00:18 +02:00
ailin-nemui
e300fee93d
Merge pull request #81 from ailin-nemui/pubnotices
add new PUBNOTICES level
2022-04-21 21:09:20 +02:00
Ailin Nemui
7360944900 add new PUBNOTICES level
separating private notices and channel notices
2022-04-21 13:38:40 +02:00
ailin-nemui
ae5a9283ee
Merge pull request #79 from ailin-nemui/query-bounds
restore irc bound queries
2022-03-18 22:58:39 +01:00
ailin-nemui
ed4ec313a2
Merge pull request #80 from ailin-nemui/meson
don't do stupid things
2022-03-18 22:45:00 +01:00
Ailin Nemui
cfd421a948 update meson requirement, add check for built files 2022-03-18 22:31:40 +01:00
Ailin Nemui
8381e13e4c up abi 2022-03-16 00:07:06 +01:00
Ailin Nemui
884cabd55d restore irc bound queries 2022-03-16 00:02:29 +01:00
ailin-nemui
84a98d0e08
Merge pull request #76 from ailin-nemui/scroll_page_count
fix scroll_page_count settings with .
2022-03-11 12:11:18 +01:00
ailin-nemui
c62505386f
Merge pull request #77 from ailin-nemui/fix_ignore_help
Clarify the help for /ignore -time
2022-03-11 12:09:26 +01:00
ailin-nemui
4986a4f9db
Merge pull request #75 from ailin-nemui/termux
simplify termux github workflow
2022-03-11 09:14:08 +01:00
Ailin Nemui
0c49ba0bda fix clang-format 2022-03-11 09:06:37 +01:00
vague666
344398dd2a Update SYNTAX 2022-03-11 08:58:05 +01:00
vague666
82dd550184 Clarify the help 2022-03-11 08:58:05 +01:00
Ailin Nemui
8fa2d01a7f fix scroll_page_count settings with . 2022-03-11 08:56:35 +01:00
Ailin Nemui
bb4859d3d5 simplify termux github workflow 2022-03-11 08:54:44 +01:00
ailin-nemui
4bf129084f
Merge pull request #74 from ailin-nemui/makedist
Add some missing files to make-dist
2022-02-21 17:52:15 +01:00
ailin-nemui
4115e47434
Merge pull request #73 from ailin-nemui/cruft
remove deprecated defines
2022-02-21 17:15:18 +01:00
Ailin Nemui
c0929e3aaf Add some missing files to make-dist 2022-02-20 18:55:45 +01:00
Ailin Nemui
883510a3fd remove deprecated defines
- PERL_STATIC_LIBS (was not tested anymore)
- HAVE_GMODULE (always required)
- HAVE_STATIC_IRC
- HAVE_STATIC_PERL
- HAVE_SOCKS (was not working properly)
- USE_GREGEX (we use it)
2022-02-20 17:33:36 +01:00
ailin-nemui
06a7dcad99
Merge pull request #72 from ailin-nemui/load-silent-doc
add -silent switch in syntax comment and respect it without args
2022-02-20 16:29:21 +01:00
Ailin Nemui
10caed057a add -silent switch in syntax comment and respect it without args 2022-02-20 15:54:04 +01:00
ailin-nemui
854c88da03
Merge pull request #70 from ailin-nemui/update-screenshot
update screenshot
2022-02-19 23:24:58 +01:00
ailin-nemui
9b768abfd7
update screenshot 2022-02-19 23:17:49 +01:00
ailin-nemui
3a5f93bbcc
Merge pull request #69 from ailin-nemui/always-24bit
remove enable-true-color compile time switch
2022-02-19 22:45:37 +01:00
Ailin Nemui
0682cbed3c remove TERM_TRUECOLOR define 2022-02-19 22:23:29 +01:00
Ailin Nemui
b34f16e9df remove enable-true-color compile time switch 2022-02-19 22:23:29 +01:00
ailin-nemui
58efc6371a
Merge pull request #64 from ailin-nemui/remove-autotools
good-bye and thanks, autotools
2022-02-19 22:22:42 +01:00
Ailin Nemui
e692f85f4a remove install_rpath
reported by dwfreed / Unit193
2022-02-19 21:44:10 +01:00
Ailin Nemui
b8736225cf good-bye and thanks, autotools 2022-02-19 21:44:10 +01:00
ailin-nemui
cf6bc31172
Merge pull request #68 from ailin-nemui/gint64fmt
use gint64 define
2022-02-19 11:00:34 +01:00
ailin-nemui
7ec61c4ec0
Merge pull request #67 from ailin-nemui/spelling
spelling fixes
2022-02-19 10:58:05 +01:00
Ailin Nemui
9b73d152fe use gint64 define 2022-02-19 00:34:06 +01:00
Ailin Nemui
bfcafa76c0 spelling fixes
by lintian / dwfreed
2022-02-19 00:27:02 +01:00
ailin-nemui
d9b181e4a1
Merge pull request #42 from ailin-nemui/module-autoload
Protocol module autoloading
2022-02-17 18:03:12 +01:00
Ailin Nemui
b335e5526d up abi 2022-02-16 23:54:51 +01:00
Ailin Nemui
1f8e167295 test termux pkg 2022-02-16 23:54:51 +01:00
Ailin Nemui
ef2c55fc18 fix irc module in fuzzer 2022-02-16 22:05:04 +01:00
Ailin Nemui
2e6c376342 add android cross link deps 2022-02-16 21:49:11 +01:00
Ailin Nemui
89bcff606f fix meson deprecations 2022-02-16 21:49:11 +01:00
Ailin Nemui
f4938a2804 remove unused function 2022-02-16 21:49:11 +01:00
Ailin Nemui
3760fcd1ca load config on chat protocol cre 2022-02-16 21:49:11 +01:00
Ailin Nemui
bee057ff21 fix something 2022-02-16 21:49:11 +01:00
Ailin Nemui
82f8ee57c3 autoload the IRC module 2022-02-16 21:49:11 +01:00
ailin-nemui
738931762b
Merge pull request #60 from ailin-nemui/paste
Add "paste event" signal
2022-02-11 14:17:49 +01:00
Ailin Nemui
76d140650a add settings*choice functions to perl 2022-02-07 16:44:14 +01:00
ailin-nemui
27008bf447
Merge pull request #58 from ailin-nemui/erase-cutbuffer
Add empty_kill_clears_cutbuffer option
2022-02-06 16:33:20 +01:00
ailin-nemui
d523ceacf0
Merge pull request #61 from ailin-nemui/actlist_separator
Actlist separator
2022-02-06 14:38:57 +01:00
Ailin Nemui
e5d02bd57b simplify 2022-02-06 14:22:56 +01:00
Ailin Nemui
32ab41625f simplify code 2022-02-06 09:50:38 +01:00
Ailin Nemui
089cab715f fix formatting 2022-02-06 02:27:36 +01:00
Ailin Nemui
75e56297fc fix intentation 2022-02-06 02:25:19 +01:00
Mikael Magnusson
d652055060 Add empty_kill_clears_cutbuffer option
Adapted revert of 13524b1f76bb.
2022-02-06 02:24:17 +01:00
vague666
d6b55c6d43 Make redrawing of item actually work 2022-02-06 01:49:24 +01:00
vague666
de626250b5 Added statusbar_items_redraw code 2022-02-06 01:49:24 +01:00
vague666
cdda5ab759 Make actlist separator a setting 2022-02-06 01:49:24 +01:00
Ailin Nemui
f47154d1a9 support multiple scripts 2022-02-06 01:47:55 +01:00
ailin-nemui
cc411a1be0
Merge pull request #59 from ailin-nemui/ilog-domain
fix crash when accessing settings during shutdown
2022-02-06 01:11:41 +01:00
Ailin Nemui
d4ed3460fc fix some stupidness 2022-02-06 00:41:13 +01:00
Ailin Nemui
5cd13d6ea2 compatibility code for old GLib 2022-02-05 23:24:52 +01:00
Ailin Nemui
17f185d833 add setting to ignore first newline 2022-02-05 23:01:55 +01:00
Ailin Nemui
5f29b35fbe fix crash when accessing settings during shutdown 2022-02-05 22:33:34 +01:00
Ailin Nemui
4846e4f319 Add "paste event" signal 2022-02-05 22:32:57 +01:00
ailin-nemui
53187de6a2
Merge pull request #57 from ailin-nemui/lr-skip-visible
Make window left/right skip windows that are already visible in other…
2022-01-31 10:47:31 +01:00
Ailin Nemui
7b22f41ec5 formatting 2022-01-19 20:49:56 +01:00
Mikael Magnusson
29e36a8fb0 Make window left/right skip windows that are already visible in other mainwins 2022-01-19 20:41:52 +01:00
Ailin Nemui
c0123a1487 Merge tag '1.3.2-an' into integrate/1.3.2-an 2022-01-14 13:40:56 +01:00
ailin-nemui
95e3fea622
Merge pull request #56 from ailin-nemui/line-bookmark
fix crash in Perl's $view->set_bookmark
2022-01-14 11:29:25 +01:00
Ailin Nemui
937786b731 fix crash in Perl's $view->set_bookmark
reported on the freebsd issue tracker https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254237#c13
2022-01-13 19:38:36 +01:00
Ailin Nemui
d4e3655f1f update news 2021-12-30 23:25:23 +01:00
ailin-nemui
f7fd4d72e4
Merge pull request #54 from ailin-nemui/chantypes
use chantypes instead of # for irc channel defaults
2021-12-30 23:23:53 +01:00
Ailin Nemui
3e4d7ded77 use chantypes instead of # for irc channel defaults 2021-12-26 01:13:57 +01:00
Ailin Nemui
d4ad71c831 Merge tag '1.3.1-an' into integrate/1.3.1-an 2021-12-17 22:47:18 +01:00
ailin-nemui
a2feef5e73
Merge pull request #53 from ailin-nemui/keepops
keep own ops status on /upgrade
2021-12-17 22:29:15 +01:00
Ailin Nemui
60cb9451b3 keep own ops status on /upgrade 2021-12-13 15:32:30 +01:00
ailin-nemui
8281b10310
Merge pull request #52 from ailin-nemui/help
fix help text wrt SERVER LIST command
2021-12-01 23:34:53 +01:00
Ailin Nemui
62eff3d2a7 fix help text wrt SERVER LIST command 2021-12-01 23:34:20 +01:00
ailin-nemui
d33fd0c5da
Merge pull request #51 from ailin-nemui/help
fix help text wrt SERVER command
2021-12-01 22:51:43 +01:00
Ailin Nemui
8088353ed0 fix help text wrt SERVER command
reported by Remco
2021-12-01 22:50:06 +01:00
ailin-nemui
0e3f6aa4a2
Merge pull request #50 from ailin-nemui/gliblog
Improve handling of GLib log messages
2021-11-17 11:17:59 +01:00
Ailin Nemui
9579105748 up abi 2021-11-17 11:00:16 +01:00
Andrej Kacian
9b79749f6c Improve handling of GLib log messages
This patch introduces setting "glib_log_domains", which is
a space-separated list of log domain names, optionally prefixed
with a '-'. The list is parsed from left to right to determine
whether or not user wants to see message from a particular log
domain. Keywords 'all' or '*' are allowed as well.
Examples: "GLib-GIO", "all -GLib-GIO", "-*"

This patch also changes the default format for displaying GLib log
messages to include the log domain.
2021-11-17 10:59:39 +01:00
Ailin Nemui
608c7b09d7 Merge tag '1.3.0-pre8' into integrate/1.3.0 2021-11-12 09:25:47 +01:00
ailin-nemui
a54a00c803
Merge pull request #49 from ailin-nemui/dccmsgs
fix stuck meta on dcc chat
2021-11-10 14:12:47 +01:00
Ailin Nemui
2f99f3a5d3 update news 2021-11-10 13:52:18 +01:00
Ailin Nemui
c5dc3fc2a0 fix stuck meta on dcc chat 2021-11-09 21:18:40 +01:00
ailin-nemui
b9f773ba6a
Merge pull request #48 from ailin-nemui/news
add news ref
2021-11-09 14:48:54 +01:00
Ailin Nemui
8f40b3ba7b add news ref 2021-10-23 11:04:47 +02:00
Ailin Nemui
815ee7b2dd Merge tag '1.3.0-pre7' into integrate/1.3.0 2021-10-11 22:21:22 +02:00
ailin-nemui
6db881d8ef
Merge pull request #44 from ailin-nemui/lag
fix max_lag disconnect
2021-10-11 22:08:14 +02:00
ailin-nemui
f5d74bd81b
Merge pull request #45 from ailin-nemui/server-outgoing
simplify duplicate code in outgoing modify
2021-10-10 22:16:46 +02:00
Ailin Nemui
bec9e04714 up abi 2021-10-10 13:15:49 +02:00
Ailin Nemui
b22588a9ad simplify duplicate code in outgoing modify 2021-10-10 13:15:49 +02:00
ailin-nemui
ea961623f5
Merge pull request #43 from ailin-nemui/server-outgoing
remove newline from "server outgoing modify"
2021-10-10 12:45:21 +02:00
Ailin Nemui
db200f266b remove newline from "server outgoing modify" 2021-10-10 11:03:00 +02:00
Ailin Nemui
b878c7f079 fix max_lag disconnect 2021-10-09 21:26:01 +02:00
Ailin Nemui
1d3cdfa2d2 Merge tag '1.3.0-pre6' into integrate/1.3.0 2021-10-01 13:43:20 +02:00
ailin-nemui
235c5b0328
Merge pull request #41 from ailin-nemui/ports
fix /server modify port argument order
2021-09-29 18:59:09 +02:00
Ailin Nemui
2d9c27d617 fix wrong argument type in printformat 2021-09-28 13:27:56 +02:00
Ailin Nemui
4943cc5e58 fix /server modify port argument order 2021-09-27 22:20:15 +02:00
ailin-nemui
85a9dc146d
Merge pull request #39 from ailin-nemui/sync
run syncdocs.sh and syncscripts.sh
2021-09-22 12:33:10 +02:00
ailin-nemui
9f9d49a2f1
Merge pull request #38 from ailin-nemui/docs
update docs
2021-09-22 12:32:51 +02:00
Ailin Nemui
6a83eddf84 run syncdocs.sh and syncscripts.sh 2021-09-22 11:26:24 +02:00
bw1
32a3f4463c update docs
+ version()
+ $abiversion
+ parse_special()
2021-09-22 11:26:13 +02:00
ailin-nemui
db705278d2
Merge pull request #40 from ailin-nemui/gh-actions
update github actions ubuntu version to 18.04 and meson to <0.60.0
2021-09-22 11:25:32 +02:00
Ailin Nemui
df227eb094 update github actions ubuntu version to 18.04 and meson to <0.60.0 2021-09-22 11:14:13 +02:00
ailin-nemui
b0fdbb144d
Merge pull request #37 from ailin-nemui/int-min-reached
fix pedantic error in MSGLEVEL enum
2021-09-21 22:35:30 +02:00
Ailin Nemui
bcea697e7c fix pedantic error in MSGLEVEL enum
reported by horgh
2021-09-19 20:59:14 +02:00
ailin-nemui
ad8221835c
Merge pull request #36 from ailin-nemui/missing-hilights
correctly store updated message levels e.g. from /hilight
2021-09-15 17:56:45 +02:00
Ailin Nemui
515e493db3 update news 2021-09-15 17:52:44 +02:00
Ailin Nemui
949dc06af3 correctly store updated message levels e.g. from /hilight 2021-09-15 17:48:27 +02:00
ailin-nemui
d3e105a396
Merge pull request #35 from ailin-nemui/fixes
duplicate issue in NEWS
2021-09-08 13:03:14 +02:00
ailin-nemui
7e14011404
Merge pull request #34 from ailin-nemui/no-maxline
remove oragono.io/maxline-2
2021-09-08 13:03:03 +02:00
Ailin Nemui
27a73e253b duplicate issue in NEWS
reported by @tobbez
2021-09-08 12:04:18 +02:00
Ailin Nemui
85eb4f118f also remove from NEWS 2021-09-08 12:03:05 +02:00
Ailin Nemui
521c0d4e6f remove oragono.io/maxline-2 2021-09-08 11:57:25 +02:00
Ailin Nemui
2003446e98 continue head 2021-09-08 11:54:44 +02:00
238 changed files with 4099 additions and 5779 deletions

View file

@ -3,8 +3,8 @@ 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
get_pip_build_deps: pip3 install setuptools; pip3 install wheel; pip3 install 'meson<0.59.0'
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:
@ -17,7 +17,7 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: prepare required software
run: |
sudo apt install $apt_build_deps
sudo apt update; sudo apt install $apt_build_deps
eval "$get_pip_build_deps"
- name: checkout base ref
uses: actions/checkout@main
@ -36,8 +36,8 @@ jobs:
base_abi=$(getabidef base$prefix)
echo base abi : $base_abi
./base$prefix/bin/irssi --version
echo "::set-output name=base_abi::$base_abi"
- uses: actions/upload-artifact@v2
echo base_abi=$base_abi >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: base.inst
path: base
@ -52,7 +52,7 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: prepare required software
run: |
sudo apt install $apt_build_deps
sudo apt update; sudo apt install $apt_build_deps
eval "$get_pip_build_deps"
- name: checkout merge ref
uses: actions/checkout@main
@ -70,8 +70,8 @@ jobs:
merge_abi=$(getabidef merge$prefix)
echo merge abi : $merge_abi
./merge$prefix/bin/irssi --version
echo "::set-output name=merge_abi::$merge_abi"
- uses: actions/upload-artifact@v2
echo merge_abi=$merge_abi >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: merge.inst
path: merge
@ -87,14 +87,14 @@ jobs:
steps:
- name: prepare required software
run: |
sudo apt install abigail-tools
sudo apt update; sudo apt install abigail-tools
- name: fetch base build
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: base.inst
path: base
- name: fetch merge build
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: merge.inst
path: merge
@ -103,7 +103,7 @@ jobs:
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@v2
- uses: actions/upload-artifact@v4
with:
path: abipkgdiff.out
- run: |

View file

@ -5,27 +5,50 @@ on:
pull_request:
name: Check Irssi
env:
apt_build_deps: libutf8proc-dev libperl-dev libotr5-dev
apt_build_deps_meson: ninja-build
apt_build_deps_autotools: autoconf automake libtool
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
build_options_configure: --with-proxy=module --with-bot --with-perl=module --with-otr=module
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 $apt_build_deps_autotools
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: |
# make dist
./autogen.sh $build_options_configure
make dist
- uses: actions/upload-artifact@v2
./utils/make-dist.sh
- uses: actions/upload-artifact@v4
with:
path: irssi-*.tar.gz
retention-days: 1
@ -38,24 +61,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-latest]
builder: [meson, configure]
os: [ubuntu-22.04, ubuntu-latest]
compiler: [clang, gcc]
flags: [regular]
setuptools_ver: [<66]
include:
- os: ubuntu-18.04
builder: meson
meson_ver: ==0.49.2
- os: ubuntu-22.04
meson_ver: ==0.53.2
setuptools_ver: <51
- os: ubuntu-latest
builder: meson
meson_ver: <0.60.0
meson_ver: <0.63.0
- os: ubuntu-latest
builder: meson
flags: meson-latest FAILURE-OK
steps:
- name: fetch dist
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
- name: set PATH
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
@ -64,8 +84,8 @@ jobs:
meson_ver: ${{ matrix.meson_ver }}
setuptools_ver: ${{ matrix.setuptools_ver }}
run: |
sudo apt update && sudo apt install $apt_build_deps $apt_build_deps_${{ matrix.builder }}
eval "$get_pip_build_deps_${{ matrix.builder }}"
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
@ -76,31 +96,12 @@ jobs:
meson Build $build_options_meson --prefix=${prefix/\~/~}
ninja -C Build
ninja -C Build install
if: ${{ matrix.builder == 'meson' }}
- name: build and install with Makefile
run: |
# make install
cd irssi-*/
mkdir Build
cd Build
../configure $build_options_configure --prefix=${prefix/\~/~} --enable-always-build-tests
make CFLAGS="-Wall -Werror -Werror=declaration-after-statement"
make install
if: ${{ matrix.builder == 'configure' }}
- name: run tests with Makefile
run: |
# make check
cd irssi-*/Build
make -C tests -sk check
find -name test-suite.log -exec cat {} +
if: ${{ matrix.builder == 'configure' }}
- 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 {} +
if: ${{ matrix.builder == 'meson' }}
- name: run launch test
env:
TERM: xterm
@ -115,6 +116,10 @@ jobs:
^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
@ -141,7 +146,7 @@ jobs:
meson_ver: ${{ matrix.meson_ver }}
setuptools_ver: ${{ matrix.setuptools_ver }}
run: |
sudo apt update && sudo apt install $apt_build_deps $apt_build_deps_meson
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
@ -163,6 +168,10 @@ jobs:
^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

View file

@ -44,7 +44,7 @@ jobs:
dry-run: false
sanitizer: ${{ matrix.sanitizer }}
- name: Upload Crash
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
if: failure() && steps.build.outcome == 'success'
with:
name: ${{ matrix.sanitizer }}-artifacts

View file

@ -22,8 +22,8 @@ jobs:
|
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@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: git-clang-format.diff
path: git-clang-format.diff
path: git-clang-format.diff

32
.github/workflows/muon-fmt.yml vendored Normal file
View file

@ -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

104
.github/workflows/solarisvm.yml vendored Normal file
View file

@ -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.*

79
.github/workflows/termuxpkg.yml vendored Normal file
View file

@ -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

20
.github/workflows/trigger-pages.yml vendored Normal file
View file

@ -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'
})

75
.github/workflows/voiddocker.yml vendored Normal file
View file

@ -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.*

3
.gitignore vendored
View file

@ -86,3 +86,6 @@ src/fe-fuzz/oom-*
Build
subprojects/*
!subprojects/*.wrap
Irssi-Dist
setup.cfg
*.egg-info

14
.muon_fmt.ini Normal file
View file

@ -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

13
.obs/workflows.yml Normal file
View file

@ -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

64
INSTALL
View file

@ -4,11 +4,15 @@
To compile Irssi you need:
- meson-0.49 build system with ninja-1.5 or greater
- meson-0.53 build system with ninja-1.8 or greater
- pkg-config (or compatible)
- glib-2.32 or greater
- openssl (for ssl support)
- perl-5.8 or greater (for building, and optionally Perl scripts)
(n.b a complete perl is needed, including ExtUtils::Embed and xsubpp)
- terminfo or ncurses (for text frontend)
- utf8proc (optional, for additional char width calculation)
- libgcrypt (for OTR)
For most people, this should work just fine:
@ -17,21 +21,12 @@ For most people, this should work just fine:
su
ninja -C Build install
For the moment, autotools is also supported:
meson options
./autogen.sh (for people who just cloned the repository)
./configure (if this script already exists, skip ./autogen.sh)
make
su
make install (not _really_ required except for perl support)
configure options
These options can be given to meson or ./configure.
The first syntax is for meson, the 2nd for ./configure
These options can be given to meson.
For a complete list of options, run
meson configure / ./configure --help
meson configure
--prefix
@ -39,33 +34,28 @@ configure options
YES, you can install Irssi WITHOUT ROOT permissions
by using --prefix=/home/dir
-Dwith-proxy=yes / --with-proxy
-Dwith-proxy=yes
Build the Irssi proxy (see startup-HOWTO).
-Dwith-perl=[yes|no] / --with-perl=[yes|no|module]
-Dwith-perl=[yes|no]
Enable Perl support
yes enable builtin (default)
no disable
module enable as module
-Dwith-perl-lib=[site|vendor|DIR] / --with-perl-lib=[site|vendor|DIR]
-Dwith-perl-lib=[site|vendor|DIR]
Specify installation dir for Perl libraries
site install in dir for site-specific modules (default)
vendor install in dir for vendor-specific modules
DIR install in DIR
[N/A] / --with-socks
Build with socks library
-Dwith-bot=yes / --with-bot
-Dwith-bot=yes
Build irssi-bot
-Dwithout-textui=yes / --without-textui
-Dwithout-textui=yes
Build without text frontend
@ -82,31 +72,18 @@ the -Dc_args and -Dc_link_args options variable, eg.:
Perl support generates most of the problems. There's quite a many
things that can go wrong:
- Compiling fails if you compile irssi with GCC in a system that has
perl compiled with some other C compiler. Very common problem with
non-Linux/BSD systems. You'll need to edit src/perl/*/Makefile files
and remove the parameters that gcc doesn't like. Mostly you'll just
need to keep the -I and -D parameters and add -fPIC.
- If there's any weird crashing at startup, you might have older irssi's
perl libraries installed somewhere, and you should remove those.
- Dynamic libraries don't want to work with some systems, so if your
system complains about some missing symbol in Irssi.so file, configure
irssi with --with-perl-staticlib option (NOT same as --with-perl=static).
- If configure complains that it doesn't find some perl stuff, you're
- If meson complains that it doesn't find some perl stuff, you're
probably missing libperl.so or libperl.a. In debian, you'll need to do
apt-get install libperl-dev
- For unprivileged home directory installations, you probably do not want
to specify --with-perl-lib=(site|vendor). Instead, you can use the
default perl installation target (below the irssi prefix). If you are
using local::lib you can also choose to install there by specifying
--with-perl-lib=$PERL_LOCAL_LIB_ROOT/lib/perl5
You can verify that the perl module is loaded and working with "/LOAD"
command. It should print something like:
Module Type Submodules
...
perl static core fe
perl dynamic fe core
System specific notes
@ -134,16 +111,7 @@ would call:
Getting perl scripting to work needs a few things:
- configure with --with-perl-staticlib
- libperl.dll is required in linking and running irssi, it's normally
located somewhere around /usr/lib/perl5/5.6.1/cygwin/CORE/libperl5_6_1.dll
copy it to eg. /usr/bin/libperl.dll
- -DUSEIMPORTLIB is needed to be defined while compiling src/perl directory.
It doesn't hurt to be defined everywhere, so configure irssi with:
CFLAGS='-DUSEIMPORTLIB' ./configure --with-perl-staticlib
- TODO
Apple MacOS / Darwin

35
MANIFEST.in Normal file
View file

@ -0,0 +1,35 @@
global-include meson.build
recursive-include src *.c *.h meson.build
recursive-include src/perl *.c *.h *.xs *.pm *.pl typemap meson.build
recursive-include src/fe-fuzz *.c *.h *.txt meson.build
recursive-include tests *.c meson.build
include meson_options.txt
include subprojects/*.wrap
# prune subprojects/*
include utils/*.pl utils/*.sh
exclude utils/make-dist.sh
include irssi.conf
include themes/*.theme
include docs/*.1 docs/*.txt docs/*.html
include docs/help/in/[a-z]*.in
include scripts/*.pl scripts/examples/*.pl
include irssi-icon.png
include NEWS
include INSTALL
include TODO
include ChangeLog
include .clang-format
# prune Build
# prune dist
prune *.egg-info
# ignore fuzz-support/fuzz.diff
# ignore utils/clang-format-xs/*

View file

@ -1,35 +0,0 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
# create default-config.h
BUILT_SOURCES = default-config.h default-theme.h irssi-version.h
CLEANFILES = default-config.h default-theme.h
@MAINTAINER_MODE_TRUE@.PHONY: irssi-version.h
default-config.h: $(srcdir)/irssi.conf
$(srcdir)/utils/file2header.sh $(srcdir)/irssi.conf default_config > default-config.h
default-theme.h: $(srcdir)/themes/default.theme
$(srcdir)/utils/file2header.sh $(srcdir)/themes/default.theme default_theme > default-theme.h
irssi-version.h:
VERSION="$(VERSION)" $(srcdir)/utils/irssi-version.sh $(srcdir) | \
cmp -s - $@ || VERSION="$(VERSION)" $(srcdir)/utils/irssi-version.sh $(srcdir) >$@
SUBDIRS = src tests docs scripts themes utils
confdir = $(sysconfdir)
conf_DATA = irssi.conf
pkgconfig_DATA = irssi-1.pc
pkginclude_HEADERS = irssi-config.h irssi-version.h
EXTRA_DIST = \
ChangeLog \
autogen.sh \
README.md \
$(conf_DATA) \
irssi-icon.png \
meson.build \
meson_options.txt

2
NEWS
View file

@ -1,3 +1,5 @@
v1.5-head 202x-xx-xx The Irssi team <staff@irssi.org>
v1.4.5 2023-10-03 The Irssi team <staff@irssi.org>
+ Add workaround for Perl 5.38.0 bug that breaks the Irssi
locale and glyph rendering (scripts.irssi.org#857, #1498)

View file

@ -17,7 +17,7 @@ available.
#### Development source installation
[Ninja](https://ninja-build.org/) 1.5 and [Meson](https://mesonbuild.com/) 0.49
[Ninja](https://ninja-build.org/) 1.8 and [Meson](https://mesonbuild.com/) 0.53
```
git clone https://github.com/irssi/irssi
@ -29,7 +29,7 @@ ninja -C Build && sudo ninja -C Build install
#### Release source installation
* Download [release](https://github.com/irssi/irssi/releases)
* [Verify](https://irssi.org/download/#release-sources) signature
* Verify signature
```
tar xJf irssi-*.tar.xz
cd irssi-*
@ -41,15 +41,15 @@ ninja -C Build && sudo ninja -C Build install
- [glib-2.32](https://wiki.gnome.org/Projects/GLib) or greater
- [openssl](https://www.openssl.org/)
- [perl-5.6](https://www.perl.org/) or greater (for perl support)
- [perl-5.8](https://www.perl.org/) or greater (for perl support)
- terminfo or ncurses (for text frontend)
#### See the [INSTALL](INSTALL) file for details
## [Documentation](https://irssi.org/documentation/)
* [Frequently Asked Questions](https://irssi.org/documentation/faq)
* [Startup How-To](https://irssi.org/documentation/startup)
* [New users guide](https://irssi.org/New-users/)
* [Questions and Answers](https://irssi.org/documentation/qna/)
* Check the built-in `/HELP`, it has all the details on command syntax
## [Themes](https://irssi-import.github.io/themes/)
@ -62,7 +62,7 @@ ninja -C Build && sudo ninja -C Build install
Please report security issues to staff@irssi.org. Thanks!
## [Bugs](https://github.com/irssi/irssi/issues) / Suggestions / [Contributing](https://irssi.org/development/)
## [Bugs](https://github.com/irssi/irssi/issues) / Suggestions / Contributing
Check the GitHub issues if it is already listed in there; if not, open
an issue on GitHub or send a mail to [staff@irssi.org](mailto:staff@irssi.org).

View file

@ -1,67 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
PKG_NAME="Irssi"
srcdir=`dirname "$0"`
test -z "$srcdir" && srcdir=.
mydir=`pwd`
if test ! -f "$srcdir"/configure.ac; then
echo -n "**Error**: Directory \`$srcdir' does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
fi
cd "$srcdir"
# create help files
echo "Creating help files..."
perl utils/syntax.pl
echo "Creating ChangeLog..."
git log > ChangeLog
if test "$?" -ne 0; then
echo "**Error**: ${PKG_NAME} Autogen must be run in a git clone, cannot proceed."
exit 1
fi
files=`echo docs/help/in/*.in|sed -e 's,docs/help/in/Makefile.in ,,' -e 's,docs/help/in/,!,g' -e 's/\.in /.in ?/g'`
cat docs/help/in/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/in/Makefile.am
files=`echo $files|sed 's/\.in//g'`
cat docs/help/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/Makefile.am
if test x$NOCONFIGURE = x && test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
rm -f aclocal.m4
echo "Running autoreconf ..."
autoreconf -i || exit $?
# make sure perl hashes have correct length
find src/perl -name '*.c' -o -name '*.xs' -exec grep -n hv_store {} + | perl -l -ne 'if (/"(\w+)",\s*(\d+)/ && $2 != length $1) { $X=1; print "Incorrect key length in $_" } END { exit $X }'
cd "$mydir"
conf_flags="--enable-maintainer-mode"
if test x$NOCONFIGURE = x; then
echo Running "$srcdir"/configure $conf_flags "$@" ...
"$srcdir"/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME || exit 1
else
echo Skipping configure process.
fi
if grep -q '==\|\[\[' "$srcdir"/build-aux/test-driver; then
echo
echo "************************************************************************"
echo "**Warning**: your build is not portable, please do not make dist"
echo " see https://bugzilla.opensuse.org/show_bug.cgi?id=1076146"
echo "************************************************************************"
fi

View file

@ -1,821 +0,0 @@
AC_INIT(irssi, 1.4.5)
AC_CONFIG_SRCDIR([src])
AC_CONFIG_AUX_DIR(build-aux)
AC_PREREQ(2.50)
AC_CONFIG_HEADERS([irssi-config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.9 no-define foreign subdir-objects nostdinc])
AM_SILENT_RULES([yes])
AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_CPP
AM_PROG_LIBTOOL
AC_PATH_PROG(sedpath, sed)
AC_PATH_PROG(perlpath, perl)
PKG_INSTALLDIR
AC_CHECK_HEADERS(unistd.h dirent.h sys/ioctl.h sys/resource.h)
# check posix headers..
AC_CHECK_HEADERS(sys/socket.h sys/time.h sys/utsname.h)
AC_SYS_LARGEFILE
AC_ARG_WITH(socks,
[ --with-socks Build with socks support],
if test x$withval = xno; then
want_socks=no
else
want_socks=yes
fi,
want_socks=no)
AC_ARG_WITH(textui,
[ --without-textui Build without text frontend],
if test x$withval = xno; then
want_textui=no
else
want_textui=yes
fi,
want_textui=yes)
AC_ARG_WITH(bot,
[ --with-bot Build irssi-bot],
if test x$withval = xno; then
want_irssibot=no
else
want_irssibot=yes
fi,
want_irssibot=no)
AC_ARG_WITH(fuzzer,
[ --with-fuzzer Build irssi-fuzzer],
if test x$withval = xno; then
want_irssifuzzer=no
else
want_irssifuzzer=yes
fi,
want_irssifuzzer=no)
AC_ARG_WITH(fuzzer-lib,
[ --with-fuzzer-lib Specify path to fuzzer library],
fuzzerlibpath="$withval")
AC_ARG_WITH(proxy,
[ --with-proxy Build irssi-proxy],
if test x$withval = xno; then
want_irssiproxy=no
else
want_irssiproxy=yes
fi,
want_irssiproxy=no)
AC_ARG_WITH(modules,
[ --with-modules Specify what modules to build in binary],
if test x$withval != xyes -a x$withval != xno; then
build_modules="$withval"
fi)
if test "x$prefix" != "xNONE"; then
prefix=`eval echo $prefix`
PERL_MM_PARAMS="INSTALLDIRS=perl INSTALL_BASE=$prefix"
perl_set_use_lib=yes
perl_prefix_note=yes
fi
AC_ARG_WITH(perl-staticlib,
[ --with-perl-staticlib Specify that we want to link perl libraries
statically in irssi, default is no],
if test x$withval = xno; then
want_staticperllib=no
else
want_staticperllib=yes
fi,
want_staticperllib=no)
AC_ARG_WITH(perl-lib,
[ --with-perl-lib=[perl|site|vendor|DIR] Specify where to install the
Perl libraries for irssi, default is site],
if test "x$withval" = xyes; then
want_perl=yes
elif test "x$withval" = xno; then
want_perl=no
elif test "x$withval" = xperl; then
want_perl=yes
perl_prefix_note=no
PERL_MM_PARAMS="INSTALLDIRS=perl"
perl_set_use_lib=no
elif test "x$withval" = xsite; then
want_perl=yes
perl_prefix_note=no
PERL_MM_PARAMS=""
perl_set_use_lib=no
elif test "x$withval" = xvendor; then
want_perl=yes
perl_prefix_note=no
if test -z "`$perlpath -v|grep '5\.0'`"; then
PERL_MM_PARAMS="INSTALLDIRS=vendor"
else
PERL_MM_PARAMS="INSTALLDIRS=perl PREFIX=`$perlpath -e 'use Config; print $Config{prefix}'`"
fi
perl_set_use_lib=no
else
want_perl=yes
perl_prefix_note=no
PERL_MM_PARAMS="INSTALLDIRS=perl LIB=$withval"
perl_set_use_lib=yes
fi,
want_perl=yes)
AC_ARG_WITH(perl,
[ --with-perl[=yes|no|module] Build with Perl support - also specifies
if it should be built into main irssi binary
(static, default) or as module],
if test x$withval = xyes; then
want_perl=static
elif test x$withval = xstatic; then
want_perl=static
elif test x$withval = xmodule; then
want_perl=module
else
want_perl=no
fi,
want_perl=static)
AC_ARG_WITH(otr,
[ --with-otr[=yes|no|static] Build with OTR support - also specifies
if it should be built into the main irssi
binary (static) or as a module (default)],
if test x$withval = xyes; then
want_otr=module
elif test x$withval = xstatic; then
want_otr=static
elif test x$withval = xmodule; then
want_otr=module
else
want_otr=no
fi,
want_otr=no)
AC_ARG_ENABLE(true-color,
[ --enable-true-color Build with true color support in terminal],
if test x$enableval = xno ; then
want_truecolor=no
else
want_truecolor=yes
fi,
want_truecolor=no)
AC_ARG_ENABLE(gregex,
[ --disable-gregex Build without GRegex (fall back to regex.h)],
if test x$enableval = xno ; then
want_gregex=no
else
want_gregex=yes
fi,
want_gregex=yes)
AC_ARG_ENABLE(utf8proc,
[ --disable-utf8proc Build without Julia's utf8proc],
if test x$enableval = xno ; then
want_utf8proc=no
else
want_utf8proc=yes
fi,
want_utf8proc=yes)
AC_ARG_WITH(capsicum,
[ --with-capsicum Build with Capsicum support],
if test x$withval = xno; then
want_capsicum=no
else
want_capsicum=yes
fi,
want_capsicum=yes)
dnl **
dnl ** just some generic stuff...
dnl **
dnl * OS specific options
case "$host_os" in
hpux*)
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
;;
*)
;;
esac
AC_SEARCH_LIBS([socket], [network socket])
AC_SEARCH_LIBS([inet_addr], [nsl])
dnl * gcc specific options
if test "x$ac_cv_prog_gcc" = "xyes"; then
CFLAGS="$CFLAGS -Wall"
fi
AC_CHECK_TYPE(socklen_t, ,
[AC_DEFINE([socklen_t], [int], [Define to 'int' if <sys/socket.h> doesn't define.])], [
AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
])
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(off_t)
if test $ac_cv_sizeof_off_t = 8; then
offt_64bit=yes
else
offt_64bit=no
fi
dnl **
dnl ** check for socks
dnl **
if test "x$want_socks" = "xyes"; then
AC_CHECK_LIB(socks, connect, [
AC_DEFINE(HAVE_SOCKS,, Build with socks support)
LIBS="$LIBS -lsocks"
AC_CHECK_HEADER(socks.h, [
AC_DEFINE(HAVE_SOCKS_H)
CFLAGS="$CFLAGS -DSOCKS"
AC_MSG_RESULT(["socks5 library found, building with it"])
], [
AC_MSG_RESULT(["socks4 library found, building with it"])
CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dgetpeername=Rgetpeername -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
])
])
fi
dnl **
dnl ** fe-text checks
dnl **
for try in 1 2; do
if test $try = 1; then
glib_modules=gmodule
else
echo "*** trying without -lgmodule"
glib_modules=
fi
AM_PATH_GLIB_2_0(2.32.0,,, $glib_modules)
if test "$GLIB_LIBS"; then
if test $glib_modules = gmodule; then
AC_DEFINE(HAVE_GMODULE)
have_gmodule=yes
fi
break
fi
done
if test -z "$GLIB_LIBS"; then
echo
echo "*** If you don't have GLIB, you can get it from ftp://ftp.gtk.org/pub/glib/"
echo "*** We recommend you get the latest stable GLIB 2 version."
echo "*** Compile and install it, and make sure pkg-config finds it,"
echo "*** by adding the path where the .pc file is located to PKG_CONFIG_PATH"
echo -n "*** Or alternatively install your distribution's package"
if test -f /etc/debian_version; then
echo :
echo "*** sudo apt-get install libglib2.0-dev"
elif test -f /etc/redhat-release; then
echo " (glib2-devel)"
else
echo .
fi
echo
AC_ERROR([GLIB is required to build irssi.])
fi
LIBS="$LIBS $GLIB_LIBS"
GLIB_TESTS
dnl **
dnl ** OpenSSL checks
dnl **
PKG_CHECK_MODULES([OPENSSL], [openssl], [
CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
LIBS="$LIBS $OPENSSL_LIBS"
], [
AC_CHECK_LIB([ssl], [SSL_library_init], [
LIBS="$LIBS -lssl -lcrypto"
], [
AC_MSG_ERROR([The OpenSSL library was not found])
])
])
dnl **
dnl ** utf8proc
dnl **
if test "x$want_utf8proc" != "xno"; then
AC_CHECK_HEADER([utf8proc.h], [
AC_CHECK_LIB([utf8proc], [utf8proc_version], [
want_utf8proc=yes
AC_DEFINE(HAVE_LIBUTF8PROC,, [Define to 1 if you have the `utf8proc' library (-lutf8proc).])
LIBS="$LIBS -lutf8proc"
], [
want_utf8proc="no, library not found"
])
], [
want_utf8proc="no, library header not found"
])
fi
dnl **
dnl ** curses checks
dnl **
if test "x$want_textui" != "xno"; then
TEXTUI_NO_LIBS="$LIBS"
LIBS=
AC_SEARCH_LIBS([setupterm], [tinfo ncursesw ncurses terminfo], [want_textui=yes], [
AC_ERROR(Terminfo not found - install libncurses-dev or ncurses-devel package)
want_textui="no, Terminfo not found"
])
TEXTUI_LIBS="$LIBS"
AC_SUBST(TEXTUI_LIBS)
LIBS="$TEXTUI_NO_LIBS"
AC_CHECK_HEADER([term.h], [
AC_DEFINE(HAVE_TERM_H, [], [Define to 1 if you have the `term.h' header.])
])
fi
dnl **
dnl ** irssifuzzer checks
dnl **
if test "$want_irssifuzzer" != "no"; then
dnl * we need to build with -fsanitize-coverage=trace-pc-guard
dnl * otherwise fuzzer won't be very successful at finding bugs :)
if test -z "$SANFLAGS"; then
SANFLAGS="-g -fsanitize=address -fsanitize-coverage=trace-pc-guard"
fi
CFLAGS="$CFLAGS $SANFLAGS"
CXXFLAGS="$CXXFLAGS $SANFLAGS"
AC_MSG_CHECKING(for fuzzer library)
if test -z "$fuzzerlibpath"; then
AC_MSG_RESULT([not found, building without fuzzer front end])
want_irssifuzzer=no
else
FUZZER_LIBS="$fuzzerlibpath"
AC_SUBST(FUZZER_LIBS)
fi
fi
dnl **
dnl ** perl checks
dnl **
if test "$want_perl" != "no"; then
AC_MSG_CHECKING(for working Perl support)
if test -z "$perlpath"; then
perl_check_error="perl binary not found"
else
PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
fi
if test "x$ac_cv_prog_gcc" = "xyes" -a -z "`echo $host_os|grep 'bsd\|linux'`"; then
dnl * several systems have Perl compiled with native compiler
dnl * but irssi is being compiled with GCC. Here we try to
dnl * fix those command line options a bit so GCC won't
dnl * complain about them. Normally there's only few options
dnl * that we want to keep:
dnl * -Ddefine -Uundef -I/path -fopt -mopt -iwithsysroot
PERL_CFLAGS=`echo $PERL_CFLAGS | $perlpath -pe 's/^(.* )?-@<:@^DUIifm@:>@@<:@^ @:>@+/\1/g; s/^(.* )?\+@<:@^ @:>@+/\1/g'`
PERL_EXTRA_OPTS="CCCDLFLAGS=\"-fPIC\""
AC_SUBST(PERL_EXTRA_OPTS)
fi
if test -z "$PERL_CFLAGS"; then
if test -n "$perl_check_error"; then
perl_check_error="Error getting perl CFLAGS"
fi
AC_MSG_RESULT([not found, building without Perl])
want_perl=no
else
PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts 2>/dev/null`
dnl * remove all database stuffs
dnl * nsl is already in ldflags
dnl * libc is of course linked without needing -lc
dnl * -rdynamic must not be in LIBADD line
for word in -ldb -ldbm -lndbm -lgdbm -lc -rdynamic; do
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e "s/$word //" -e "s/$word$//"`
done
case "$host_os" in
linux*)
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-lposix //' -e 's/-lposix$//'`
;;
hpux*)
if test "x$ac_cv_prog_gcc" = "xyes"; then
PERL_CFLAGS=`echo $PERL_CFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
PERL_LDFLAGS=`echo $PERL_LDFLAGS | $sedpath -e 's/-Ae //' -e 's/-Ae$//'`
fi
;;
*)
;;
esac
dnl * check that perl's ldflags actually work
echo "#include <EXTERN.h>" > conftest.c
echo "#include <perl.h>" >> conftest.c
echo "int main(){perl_alloc(); return 0;}" >> conftest.c
$CC $CFLAGS $PERL_CFLAGS conftest.c -o conftest $LDFLAGS $PERL_LDFLAGS 2> perl.error.tmp > /dev/null
if test ! -s conftest -a "x$ignore_perl_errors" = "x"; then
perl_check_error="Error linking with perl libraries: $PERL_LDFLAGS: `cat perl.error.tmp`"
AC_MSG_RESULT([error linking with perl libraries, building without Perl])
want_perl=no
fi
rm -f perl.error.tmp
fi
if test "x$want_perl" != "xno"; then
AC_MSG_RESULT(ok)
if test "x$want_perl" = "xstatic"; then
dnl * building with static perl support
dnl * all PERL_LDFLAGS linking is done in fe-text
PERL_LINK_FLAGS="$PERL_LDFLAGS"
PERL_LINK_LIBS="../perl/libperl_core_static.la"
PERL_FE_LINK_LIBS="../perl/libfe_perl_static.la"
PERL_LDFLAGS=
AC_DEFINE(HAVE_STATIC_PERL)
dnl * build only static library of perl module
perl_module_lib=
perl_module_fe_lib=
perl_static_lib=libperl_core_static.la
perl_static_fe_lib=libfe_perl_static.la
else
dnl * build dynamic library of perl module
perl_module_lib=libperl_core.la
perl_module_fe_lib=libfe_perl.la
perl_static_lib=
perl_static_fe_lib=
fi
if test "x$want_staticperllib" = "xyes"; then
PERL_MM_PARAMS="$PERL_MM_PARAMS LINKTYPE=static"
PERL_LINK_LIBS="$PERL_LINK_LIBS ../perl/common/blib/arch/auto/Irssi/Irssi.a ../perl/irc/blib/arch/auto/Irssi/Irc/Irc.a ../perl/ui/blib/arch/auto/Irssi/UI/UI.a ../perl/textui/blib/arch/auto/Irssi/TextUI/TextUI.a"
PERL_STATIC_LIBS=1
else
PERL_STATIC_LIBS=0
fi
# remove any prefix from PERL_MM_OPT
PERL_MM_OPT=`perl -MText::ParseWords -e 'sub qu{$_=shift;s{^(.*?)=(.*)$}{($a,$b)=($1,$2);$b=~s/"/\\\\"/g;qq{$a="$b"}}ge if /@<:@\s"@:>@/;$_} local $,=" "; print map qu($_), grep !/^(INSTALL_BASE|PREFIX)=/, shellwords(@ARGV)' "$PERL_MM_OPT"`
# figure out the correct @INC path - we'll need to do this
# through MakeMaker since it's difficult to get it right
# otherwise.
$perlpath -MExtUtils::MakeMaker -e 'WriteMakefile(NAME => "test", MAKEFILE => "Makefile.test", FIRST_MAKEFILE => "/dev/null", NO_META => 1, NO_MYMETA => 1);' $PERL_MM_PARAMS >/dev/null
echo 'show-INSTALLDIRS:' >> Makefile.test
echo ' @echo $(INSTALLDIRS)' >> Makefile.test
perl_INSTALLDIRS=`$am_make -s -f Makefile.test show-INSTALLDIRS`
if test "x$perl_INSTALLDIRS" = "xsite"; then
perl_library_dir="site default"
perl_INSTALL_VAR=INSTALLSITEARCH
elif test "x$perl_INSTALLDIRS" = "xvendor"; then
perl_library_dir="vendor default"
perl_INSTALL_VAR=INSTALLVENDORARCH
else
perl_library_dir="module default"
perl_INSTALL_VAR=INSTALLARCHLIB
fi
echo 'show-ARCHLIB:' >> Makefile.test
echo ' @echo $('"$perl_INSTALL_VAR"')' >> Makefile.test
perl_use_lib=`$am_make -s -f Makefile.test show-ARCHLIB`
rm -f Makefile.test
if test "x$perl_set_use_lib" = "xyes"; then
if $perlpath -e 'exit ! grep $_ eq $ARGV@<:@0@:>@, grep /^\//, @INC' "$perl_use_lib"; then
perl_library_dir="other path in @INC"
perl_set_use_lib=no
else
perl_library_dir="prepends to @INC with /set perl_use_lib"
PERL_USE_LIB="$perl_use_lib"
fi
fi
AC_SUBST(perl_module_lib)
AC_SUBST(perl_static_lib)
AC_SUBST(perl_module_fe_lib)
AC_SUBST(perl_static_fe_lib)
AC_SUBST(PERL_LINK_FLAGS)
AC_SUBST(PERL_LINK_LIBS)
AC_SUBST(PERL_FE_LINK_LIBS)
AC_SUBST(PERL_LDFLAGS)
AC_SUBST(PERL_CFLAGS)
AC_SUBST(PERL_USE_LIB)
AC_SUBST(PERL_MM_OPT)
AC_SUBST(PERL_MM_PARAMS)
AC_SUBST(PERL_STATIC_LIBS)
fi
fi
dnl **
dnl ** check for capsicum
dnl **
if test "x$want_capsicum" = "xyes"; then
AC_CHECK_LIB(c, cap_enter, [
AC_CHECK_LIB(nv, nvlist_create, [
AC_DEFINE(HAVE_CAPSICUM,, Build with Capsicum support)
LIBS="$LIBS -lnv"
], [
want_capsicum="no, nvlist_create not found"
])
], [
want_capsicum="no, cap_enter not found"
])
fi
dnl **
dnl ** OTR checks
dnl **
have_otr=no
if test "x$want_otr" != "xno"; then
AM_PATH_LIBGCRYPT(1:1.2.0, [], [AC_ERROR(libgcrypt 1.2.0 or newer is required.)])
AM_PATH_LIBOTR(4.1.0, [], [AC_ERROR([libotr 4.1.0 or newer is required.])])
OTR_CFLAGS="$LIBOTR_CFLAGS $LIBGCRYPT_CFLAGS"
OTR_LDFLAGS="$LIBOTR_LIBS $LIBGCRYPT_LIBS"
AC_SUBST(otr_module_lib)
AC_SUBST(otr_static_lib)
if test "x$want_otr" != "xno"; then
if test "x$want_otr" = "xstatic"; then
otr_module_lib=
otr_static_lib=libotr_core_static.la
OTR_LINK_LIBS="../otr/libotr_core_static.la"
OTR_LINK_FLAGS="$OTR_LDFLAGS"
AC_DEFINE(HAVE_STATIC_OTR)
else
otr_module_lib=libotr_core.la
otr_static_lib=
fi
fi
AC_SUBST(otr_module_lib)
AC_SUBST(otr_static_lib)
AC_SUBST(OTR_CFLAGS)
AC_SUBST(OTR_LDFLAGS)
AC_SUBST(OTR_LINK_LIBS)
AC_SUBST(OTR_LINK_FLAGS)
have_otr=yes
fi
dnl ** check what we want to build
AM_CONDITIONAL(BUILD_TEXTUI, test "$want_textui" = "yes")
AM_CONDITIONAL(BUILD_IRSSIBOT, test "$want_irssibot" = "yes")
AM_CONDITIONAL(BUILD_IRSSIFUZZER, test "$want_irssifuzzer" = "yes")
AM_CONDITIONAL(BUILD_IRSSIPROXY, test "$want_irssiproxy" = "yes")
AM_CONDITIONAL(HAVE_PERL, test "$want_perl" != "no")
AM_CONDITIONAL(HAVE_CAPSICUM, test "x$want_capsicum" = "xyes")
AM_CONDITIONAL(USE_GREGEX, test "x$want_gregex" = "xyes")
AM_CONDITIONAL(HAVE_OTR, test "x$have_otr" != "xno")
# move LIBS to PROG_LIBS so they're not tried to be used when linking eg. perl libraries
PROG_LIBS=$LIBS
LIBS=
AC_SUBST(PROG_LIBS)
dnl **
dnl ** Keep all the libraries here so each frontend doesn't need to
dnl ** keep track of them all
dnl **
dnl ** (these could be made configurable)
CHAT_MODULES="irc"
irc_MODULES="dcc flood notifylist"
if test -n "$build_modules"; then
irc_MODULES="$irc_MODULES $build_modules"
fi
dnl ****************************************
AC_SUBST(CHAT_MODULES)
AC_SUBST(irc_MODULES)
CORE_LIBS="../core/libcore.a ../lib-config/libirssi_config.a"
FE_COMMON_LIBS=""
CHAT_LIBS=""
for c in $CHAT_MODULES; do
CHAT_LIBS="$CHAT_LIBS ../$c/lib$c.a ../$c/core/lib${c}_core.a"
if test -f $srcdir/src/fe-common/$c/module.h; then
FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/libfe_common_$c.a "
fi
for s in `eval echo \\$${c}_MODULES`; do
CHAT_LIBS="$CHAT_LIBS ../$c/$s/lib${c}_$s.a"
if test -f $srcdir/src/fe-common/$c/$s/module.h; then
FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/$c/$s/libfe_${c}_$s.a "
fi
done
done
FE_COMMON_LIBS="$FE_COMMON_LIBS../fe-common/core/libfe_common_core.a"
dnl ** common libraries needed by frontends
COMMON_NOUI_LIBS="$CHAT_LIBS $CORE_LIBS"
COMMON_LIBS="$FE_COMMON_LIBS $COMMON_NOUI_LIBS"
AC_SUBST(COMMON_NOUI_LIBS)
AC_SUBST(COMMON_LIBS)
if test "x$want_truecolor" = "xyes"; then
AC_DEFINE([TERM_TRUECOLOR], [], [true color support in terminal])
else
want_truecolor=no
fi
if test "x$want_gregex" = "xyes"; then
AC_DEFINE([USE_GREGEX], [], [use GRegex for regular expressions])
else
want_gregex=no
fi
AC_DEFINE([FHS_PREFIX], [""], [Alternate filesystem prefix for Termux])
AH_TEMPLATE(HAVE_GMODULE)
AH_TEMPLATE(HAVE_SOCKS_H, [misc..])
AH_TEMPLATE(HAVE_STATIC_PERL)
AH_TEMPLATE(HAVE_STATIC_OTR)
AH_TEMPLATE(PRIuUOFF_T, [printf()-format for uoff_t, eg. "u" or "lu" or "llu"])
AH_TEMPLATE(UOFF_T_INT, [What type should be used for uoff_t])
AH_TEMPLATE(UOFF_T_LONG)
AH_TEMPLATE(UOFF_T_LONG_LONG)
AC_CONFIG_FILES([
Makefile
src/Makefile
src/core/Makefile
src/irc/Makefile
src/irc/core/Makefile
src/irc/dcc/Makefile
src/irc/notifylist/Makefile
src/irc/proxy/Makefile
src/irc/flood/Makefile
src/fe-common/Makefile
src/fe-common/core/Makefile
src/fe-common/irc/Makefile
src/fe-common/irc/dcc/Makefile
src/fe-common/irc/notifylist/Makefile
src/fe-fuzz/Makefile
src/fe-fuzz/irc/Makefile
src/fe-fuzz/irc/core/Makefile
src/fe-fuzz/fe-common/Makefile
src/fe-fuzz/fe-common/core/Makefile
src/fe-none/Makefile
src/fe-text/Makefile
src/lib-config/Makefile
src/perl/Makefile
src/perl/common/Makefile.PL
src/perl/irc/Makefile.PL
src/perl/ui/Makefile.PL
src/perl/textui/Makefile.PL
src/otr/Makefile
scripts/Makefile
scripts/examples/Makefile
tests/Makefile
tests/fe-common/Makefile
tests/fe-common/core/Makefile
tests/fe-text/Makefile
tests/irc/Makefile
tests/irc/core/Makefile
tests/irc/flood/Makefile
docs/Makefile
docs/help/Makefile
docs/help/in/Makefile
utils/Makefile
themes/Makefile
irssi-1.pc
])
dnl ** make the paths like include headers later
AC_CONFIG_LINKS([irssi/irssi-config.h:irssi-config.h])
AC_LINK_FILES([$srcdir/src],[irssi/src])
AC_OUTPUT
$LN_S ../irssi-version.h irssi/irssi-version.h
dnl ** for building from objdir
old_dir=`pwd` && cd $srcdir && whole_dir=`pwd` && cd $old_dir
if test "x$old_dir" != "x$whole_dir"; then
$LN_S $srcdir/irssi-version.h irssi-version.h
if test "x$want_perl" != "xno"; then
subdirfiles=""
for i in $whole_dir/src/perl/common $whole_dir/src/perl/irc $whole_dir/src/perl/ui $whole_dir/src/perl/textui; do
subdirfiles=`echo $subdirfiles $i/typemap $i/*.h $i/*.pm $i/*.xs`
done
for file in $whole_dir/src/perl/module.h $subdirfiles; do
link=`echo $file|$sedpath "s?$whole_dir/??"`
rm -f $link
$LN_S $file $link
done
fi
fi
echo
echo "Building text frontend ........... : $want_textui"
echo "Building irssi bot ............... : $want_irssibot"
echo "Building irssi proxy ............. : $want_irssiproxy"
if test "x$have_gmodule" = "xyes"; then
echo "Building with module support ..... : yes"
else
echo "Building with module support : NO!! /LOAD will not work!"
echo " - You're missing gmodule (comes with glib) for some reason,"
echo " or it doesn't work in your system."
fi
if test "x$want_perl" = "xstatic"; then
echo "Building with Perl support ....... : static (in irssi binary)"
elif test "x$want_perl" = "xmodule"; then
echo "Building with Perl support ....... : module"
else
if test -z "$perl_check_error"; then
echo "Building with Perl support ....... : no"
else
echo "Building with Perl support ....... : NO!"
echo " - $perl_check_error"
if test -f /etc/debian_version; then
echo " - Try: sudo apt-get install libperl-dev"
elif test -f /etc/redhat-release; then
echo " - Try installing perl-devel"
fi
fi
fi
if test "x$want_perl" != "xno" -a "x$perl_mod_error" != "x"; then
echo " - NOTE: Perl support will be compiled statically to irssi, not as"
echo " a module as requested. Reason:"
echo " $perl_mod_error"
if test -f /etc/debian_version; then
echo " - Try: sudo apt-get install libperl-dev"
fi
fi
if test "x$want_perl" != "xno"; then
echo "Perl library directory ........... : ($perl_library_dir - $perl_use_lib)"
if test "x$perl_prefix_note" = "xyes"; then
echo " - NOTE: This was automatically set to the same directory you gave with"
echo " --prefix. If you want the perl libraries to install to their 'correct'"
echo " path, you'll need to give --with-perl-lib=site option to configure."
echo " Anyway, installing perl to this directory should work just as well."
fi
fi
echo "Install prefix ................... : $prefix"
echo
echo "Building with 64bit DCC support .. : $offt_64bit"
echo "Building with true color support.. : $want_truecolor"
echo "Building with GRegex ............. : $want_gregex"
echo "Building with Capsicum ........... : $want_capsicum"
echo "Building with utf8proc ........... : $want_utf8proc"
if test "x$want_otr" = "xstatic"; then
echo "Building with OTR support ........ : static (in irssi binary)"
elif test "x$want_otr" = "xmodule"; then
echo "Building with OTR support ........ : module"
else
echo "Building with OTR support ........ : no"
fi
echo
echo "If there are any problems, read the INSTALL file."

View file

@ -1,21 +0,0 @@
man_MANS = \
irssi.1
doc_DATA = \
capsicum.txt \
design.html \
design.txt \
formats.txt \
manual.txt \
faq.html \
faq.txt \
perl.txt \
signals.txt \
special_vars.txt \
startup-HOWTO.html \
startup-HOWTO.txt
EXTRA_DIST = $(doc_DATA) $(man_MANS) \
meson.build
SUBDIRS = help

110
docs/New-users.html Normal file
View file

@ -0,0 +1,110 @@
<base href='https://irssi.org/New-users/'>
<h1>New users guide</h1>
<section id="new-to-irc">
<h2>New to IRC</h2>
<p>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 <a class="reference external" href="https://pomf.lain.la/">https://pomf.lain.la/</a> and then pasting the HTTP links. Code snippets or longer texts are shared by pasting them to a Pastebin like <a class="reference external" href="https://paste.opensuse.org/">https://paste.opensuse.org/</a> and then sharing the HTTP link.</p>
<p>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.</p>
<p>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.</p>
<p>Each network contains many channels, rooms that are often dedicated to discussing a specific topic. You can find many channels on <a class="reference external" href="https://netsplit.de/">https://netsplit.de/</a> or using a search engine with the keyword “IRC”. Irssi supports joining many channels at the same time.</p>
<p>There is a rather large IRC network catering to free and open-source software and peer directed projects at <a class="reference external" href="https://libera.chat/">https://libera.chat/</a> and a smaller one at <a class="reference external" href="https://www.oftc.net/">https://www.oftc.net/</a> many free software projects still have support channels on these IRC networks (although some have moved to Matrix or proprietary platforms like Discord).</p>
</section>
<section id="first-start">
<h2>First start</h2>
<p>After (compiling and) installing Irssi, to start it, open a shell (Terminal) and type:</p>
<div class="highlight-default notranslate"><div><pre>irssi
</pre></div>
</div>
<p>You should be greeted by a blinking cursor behind <code class="docutils literal notranslate">[(status)]</code>. You are now in the status window of Irssi. Window is the Irssi name for what you might nowadays call a “Web browser tab”.</p>
<p>If youre confused about what you are seeing on the Irssi screen, you can find an annotated screenshot of it at <a class="reference internal" href="../User-interface/">User interface</a>.</p>
<p>If you want, you can pick a nick name (handle) that will be shown to others reading your messages now, by typing</p>
<div class="highlight-default notranslate"><div><pre>/set nick whatyouwant
</pre></div>
</div>
<p>Each command or message can be sent by pressing Enter. Commands in Irssi start with a <code class="docutils literal notranslate">/</code>. If there is no <code class="docutils literal notranslate">/</code>, then the line that you wrote will be sent as a message to the channel that you have open, for everyone to see.</p>
<section id="leaving">
<h3>Leaving</h3>
<p>Type <code class="docutils literal notranslate">/quit</code> to get out of Irssi.</p>
</section>
</section>
<section id="connecting-to-a-network">
<h2>Connecting to a network</h2>
<p>Irssi comes with some predefined networks. You can see the current list of networks by typing</p>
<div class="highlight-default notranslate"><div><pre>/network
</pre></div>
</div>
<p>(the list will be shown in your status window)</p>
<p>To connect to one of the networks in the list, type <code class="docutils literal notranslate">/connect networkname</code>, for example:</p>
<div class="highlight-default notranslate"><div><pre>/connect liberachat
</pre></div>
</div>
<p>You should see several messages scroll by. After a while, you should be connected to the Libera Chat network.</p>
<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>Irssi version 1.2 or older may be lacking the liberachat network entry. See <a class="reference external" href="https://github.com/shabble/irssi-docs/wiki/liberachat">https://github.com/shabble/irssi-docs/wiki/liberachat</a> for how to add it.</p>
</div>
<section id="nickname-registration">
<h3>Nickname registration</h3>
<p>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. <em>How</em> to register also differs by network. Some <em>channels</em> only allow users with registered accounts to join them, so it may be very important for you to register a user account.</p>
<p>User accounts are always specific to a network.</p>
<p>For the Libera Chat network, you can find instructions how to register and set up your account with Irssi on <a class="reference external" href="https://github.com/shabble/irssi-docs/wiki/liberachat#configure-sasl-automated-log-in">https://github.com/shabble/irssi-docs/wiki/liberachat#configure-sasl-automated-log-in</a></p>
</section>
</section>
<section id="joining-a-channel">
<h2>Joining a channel</h2>
<p>Once you are connected to a network, you can join channels by typing <code class="docutils literal notranslate">/join #channelname</code>, for example:</p>
<div class="highlight-default notranslate"><div><pre>/join #irssi
</pre></div>
</div>
<p>Now, a new window will open and you can send messages to the channel.</p>
<section id="changing-windows">
<h3>Changing windows</h3>
<p>You can change between windows using the <code class="docutils literal notranslate">Ctrl</code>+<code class="docutils literal notranslate">n</code> or <code class="docutils literal notranslate">Ctrl</code>+<code class="docutils literal notranslate">p</code> keys, orif your terminal is configured properlyusing <code class="docutils literal notranslate">Alt</code>+<code class="docutils literal notranslate">1</code>, <code class="docutils literal notranslate">Alt</code>+<code class="docutils literal notranslate">2</code>, … See <a class="reference internal" href="../documentation/help/bind_-list/">bind -list</a> for a list of all default key bindings.</p>
</section>
<section id="removing-clutter">
<h3>Removing clutter</h3>
<p>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</p>
<div class="highlight-default notranslate"><div><pre>/window hidelevel +joins +parts +quits
</pre></div>
</div>
<p>To get them back</p>
<div class="highlight-default notranslate"><div><pre>/window hidelevel -joins -parts -quits
</pre></div>
</div>
<p>If you want to hide them by default, <code class="docutils literal notranslate">/set window_default_hidelevel hidden joins parts quits</code></p>
</section>
</section>
<section id="adding-a-new-network">
<h2>Adding a new network</h2>
<p>If you want to join a network that is not there, you first need to find at least one server of that network. Lets say you have found the room <a class="reference external" href="https://netsplit.de/channels/details.php?room=%23hackint&amp;net=hackint">#hackint</a> on netsplit.de and want to join it. Then you can find that the <a class="reference external" href="https://netsplit.de/servers/?net=hackint">server</a> is irc.hackint.org, port 6697, SSL (TLS) on. To add it to Irssi, use the commands:</p>
<div class="highlight-default notranslate"><div><pre>/network add hackint
/server add -tls -network hackint irc.hackint.org 6697
</pre></div>
</div>
<p>Then, you can connect to the newly added network with</p>
<div class="highlight-default notranslate"><div><pre>/connect hackint
</pre></div>
</div>
<section id="multiple-networks">
<h3>Multiple networks</h3>
<p>If you are connected to multiple networks, you can change which one you are “talking” to (which one to send commands) by using the <code class="docutils literal notranslate">Ctrl</code>+<code class="docutils literal notranslate">x</code> key in the status window.</p>
</section>
</section>
<section id="on-line-help">
<h2>On-line help</h2>
<p>Most /commands have a help page, you can read it with</p>
<div class="highlight-default notranslate"><div><pre>/help commandname
</pre></div>
</div>
<p>or <a class="reference internal" href="../documentation/help/">on-line</a>.</p>
<p>The settings that can be changed with /SET are described on <a class="reference internal" href="../documentation/settings/">Settings Documentation</a> the settingshelp <a class="reference internal" href="#about-scripts">script</a> can be used to read it from within <code class="docutils literal notranslate">/help</code></p>
</section>
<section id="about-scripts">
<h2>About Scripts</h2>
<p>You can enhance your Irssi by installing scripts. Many Perl scripts written by other Irssi users can be found on <a class="reference external" href="https://scripts.irssi.org/">https://scripts.irssi.org/</a></p>
<p>Most of them should be compatible with Irssi 1.4 (but some may not, also see the Full Change log for some incompatible ones)</p>
</section>
<section id="about-themes">
<h2>About Themes</h2>
<p>Irssis look can be thoroughly changed with themes. Many themes created by other Irssi users can be found on <a class="reference external" href="https://themes.irssi.org/">https://themes.irssi.org/</a></p>
<p>If you want to modify the look of Irssi yourself, the <em>default</em> theme which can be found in your <code class="docutils literal notranslate">~/.irssi</code> folder is a good starting point. It also has a few comments explaining what some of the abstracts are used for</p>
</section>

193
docs/New-users.txt Normal file
View file

@ -0,0 +1,193 @@
# New users guide #
## New to IRC ##
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 [1]https://
pomf.lain.la/ and then pasting the HTTP links. Code snippets or longer texts
are shared by pasting them to a Pastebin like [2]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 [3]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 [4]https://libera.chat/ and a smaller one at [5]
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).
## First start ##
After (compiling and) installing Irssi, to start it, open a shell (Terminal)
and type:
irssi
You should be greeted by a blinking cursor behind [(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”.
If youre confused about what you are seeing on the Irssi screen, you can find
an annotated screenshot of it at [6]User interface.
If you want, you can pick a nick name (handle) that will be shown to others
reading your messages now, by typing
/set nick whatyouwant
Each command or message can be sent by pressing Enter. Commands in Irssi start
with a /. 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 ###
Type /quit to get out of Irssi.
## Connecting to a network ##
Irssi comes with some predefined networks. You can see the current list of
networks by typing
/network
(the list will be shown in your status window)
To connect to one of the networks in the list, type /connect networkname, for
example:
/connect liberachat
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 [7]
https://github.com/shabble/irssi-docs/wiki/liberachat for how to add it.
### Nickname registration ###
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 [8]https://github.com/shabble/irssi-docs/wiki/
liberachat#configure-sasl-automated-log-in
## Joining a channel ##
Once you are connected to a network, you can join channels by typing /join #
channelname, for example:
/join #irssi
Now, a new window will open and you can send messages to the channel.
### Changing windows ###
You can change between windows using the Ctrl+n or Ctrl+p keys, orif your
terminal is configured properlyusing Alt+1, Alt+2, … See [9]bind -list for a
list of all default key bindings.
### Removing clutter ###
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
/window hidelevel +joins +parts +quits
To get them back
/window hidelevel -joins -parts -quits
If you want to hide them by default, /set window_default_hidelevel hidden joins
parts quits
## Adding a new network ##
If you want to join a network that is not there, you first need to find at
least one server of that network. Lets say you have found the room [10]#
hackint on netsplit.de and want to join it. Then you can find that the [11]
server is irc.hackint.org, port 6697, SSL (TLS) on. To add it to Irssi, use the
commands:
/network add hackint
/server add -tls -network hackint irc.hackint.org 6697
Then, you can connect to the newly added network with
/connect hackint
### Multiple networks ###
If you are connected to multiple networks, you can change which one you are
“talking” to (which one to send commands) by using the Ctrl+x key in the status
window.
## On-line help ##
Most /commands have a help page, you can read it with
/help commandname
or [12]on-line.
The settings that can be changed with /SET are described on [13]Settings
Documentation the settingshelp [14]script can be used to read it from within
/help
## About Scripts ##
You can enhance your Irssi by installing scripts. Many Perl scripts written by
other Irssi users can be found on [15]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)
## About Themes ##
Irssis look can be thoroughly changed with themes. Many themes created by
other Irssi users can be found on [16]https://themes.irssi.org/
If you want to modify the look of Irssi yourself, the default theme which can
be found in your ~/.irssi folder is a good starting point. It also has a few
comments explaining what some of the abstracts are used for
References:
[1] https://pomf.lain.la/
[2] https://paste.opensuse.org/
[3] https://netsplit.de/
[4] https://libera.chat/
[5] https://www.oftc.net/
[6] https://irssi.org/User-interface/
[7] https://github.com/shabble/irssi-docs/wiki/liberachat
[8] https://github.com/shabble/irssi-docs/wiki/liberachat#configure-sasl-automated-log-in
[9] https://irssi.org/documentation/help/bind_-list/
[10] https://netsplit.de/channels/details.php?room=%23hackint&net=hackint
[11] https://netsplit.de/servers/?net=hackint
[12] https://irssi.org/documentation/help/
[13] https://irssi.org/documentation/settings/
[14] https://irssi.org/New-users/#about-scripts
[15] https://scripts.irssi.org/
[16] https://themes.irssi.org/

View file

@ -9,13 +9,13 @@ To make Irssi enter capability mode on startup, add
capsicum = "yes";
awaylog_file = "~/irclogs/away.log";
to your ~/.irssi/config and restart the client. Alternatively you can
enter it "by hand", using the "/capsicum enter" command. From the security
point of view it's strongly preferable to use the former method, to avoid
establishing connections without the sandbox protection; the "/capsicum"
command is only intended for experimentation, and in cases where you need
to do something that's not possible in capability mode - run scripts,
for example - before continuing.
to your ~/.irssi/config in the settings/core section, and restart the
client. Alternatively you can enter it "by hand", using the
"/capsicum enter" command. From the security point of view it's strongly
preferable to use the former method, to avoid establishing connections
without the sandbox protection; the "/capsicum" command is only intended
for experimentation, and in cases where you need to do something that's not
possible in capability mode - run scripts, for example - before continuing.
There is no way to leave the capability mode, apart from exiting Irssi.
When running in capability mode, there are certain restrictions - Irssi

View file

@ -162,4 +162,4 @@ server reconnections and irc network splits</li>
<li>placing channels and queries in windows</li>
<li>nick completion</li>
<li>printing infomation of some events</li>
</ul>
</ul>

View file

@ -78,4 +78,4 @@
<h3 id="q-how-to-pronounce-irssi">Q: How to pronounce Irssi?</h3>
<p>A: Check <a href="/assets/irssi.wav">here</a></p>
<p>A: Check <a href="/assets/irssi.wav">here</a></p>

View file

@ -1,13 +0,0 @@
# Makefile.am is autogenerated by autogen.sh from Makefile.am.gen
helpdir = $(datadir)/irssi/help
help_DATA = \
@HELPFILES@
EXTRA_DIST = \
Makefile.am.gen \
$(help_DATA) \
meson.build
SUBDIRS = in

View file

@ -1,5 +0,0 @@
# Makefile.am is autogenerated by autogen.sh from Makefile.am.gen
EXTRA_DIST = \
Makefile.am.gen \
@HELPFILES@

View file

@ -17,13 +17,15 @@ Details:
Adds or removes a binding; the binding itself is case-sensitive and may
contain as many characters as you want.
Uppercase characters usually indicate that you need to keep the shift-key
pressed to use the binding.
Key bindings are case sensitive so uppercase letters mean you also have
to use the shift key, except for ctrl which does not support shift but
the keys must always be typed in uppercase.
%9Examples:%9
/BIND
/BIND meta-c /CLEAR
/BIND meta-C /CYCLE
/BIND meta-q change_window 16
/BIND -delete meta-y
/BIND ^W^C /WINDOW NEW HIDE

View file

@ -20,9 +20,10 @@
MODES A channel mode is modified.
MSGS Private messages.
NICKS A nickname changes to another nickname.
NOTICES Notices sent from a nickname.
NOTICES Private notices.
PARTS A nickname leaves a channel.
PUBLIC Public messages in a channel.
PUBNOTICES Public notices in a channel.
QUITS A nickname disconnects from IRC.
SNOTES Notices sent from a server.
TOPICS A channel topic is modified.

View file

@ -5,7 +5,7 @@
%9Parameters:%9
The server to search on and the remote sever to search on; if no arguments
The server to search on and the remote server to search on; if no arguments
are given, the active server will be used.
%9Description:%9

View file

@ -36,8 +36,8 @@
-cmdmax: Specifies the maximum number of commands to perform before
starting the internal flood protection.
-sasl_mechanism Specifies the mechanism to use for the SASL authentication.
At the moment irssi only supports the 'plain' and the
'external' mechanisms.
Irssi supports: PLAIN, EXTERNAL, SCRAM-SHA-1, SCRAM-SHA-256
and SCRAM-SHA-512
Use '' to disable the authentication.
-sasl_username Specifies the username to use during the SASL authentication.
-sasl_password Specifies the password to use during the SASL authentication.

View file

@ -20,10 +20,10 @@
%9Description:%9
Manipulate the text in the window to go to a to the given line number, or
Manipulate the text in the window to go to the given line number, or
clear the buffers.
The timestamp format is format is '[dd[.mm] | -<days ago>] hh:mi[:ss]'.
The timestamp format is '[dd[.mm] | -<days ago>] hh:mi[:ss]'.
%9Examples:%9

View file

@ -15,7 +15,6 @@
%9Examples:%9
/TOGGLE resolve_prefer_ipv6
/TOGGLE channels_rejoin_unavailable ON
%9See also:%9 SET

View file

@ -74,5 +74,5 @@
/WINDOW HIDELEVEL ^JOINS ^PARTS ^QUITS
/WINDOW LOGFILE ~/logs/notices.log
%9See also:%9 JOIN, LEVELS, LOG, QUERY
%9See also:%9 JOIN, LEVELS, LOG, QUERY, SET window_default_level, SET window_default_hidelevel

View file

@ -116,6 +116,7 @@ install_data(
'whowas',
'window',
),
install_dir : helpdir)
install_dir : helpdir,
)
# subdir('in')

View file

@ -373,9 +373,6 @@
After connected to server, Irssi can automatically change your user
mode. You can set it with /SET usermode <mode>, default is +i.
/SET resolve_prefer_ipv6 - If ON, prefer IPv6 for hosts that
have both v4 and v6 addresses.
5.5 Automatic reconnecting
If you get disconnected from server, Irssi will try to reconnect

View file

@ -13,6 +13,7 @@ install_data(
'startup-HOWTO.html',
'startup-HOWTO.txt',
),
install_dir : docdir)
install_dir : docdir,
)
subdir('help')

View file

@ -205,6 +205,12 @@ Window::command(cmd)
Windowitem::command(cmd)
Send a command `cmd' (in current channel). The '/' char isn't needed.
version() - return client release date and time (format YYYYMMDD.hhmm)
parse_special(cmd, data="", flags=0)
Server::parse_special(cmd, data="", flags=0)
Windowitem::parse_special(cmd, data="", flags=0)
evaluate a string with special vars
*** Themes
@ -516,6 +522,8 @@ Connect->{}
address - Address where we connected (irc.blah.org)
port - Port where we connected
chatnet - Chat network
chosen_family - IP family chosen to connect to
ipaddr - IP address connected to
password - Password we used in connection.
wanted_nick - Nick which we would prefer to use

52
docs/qna.html Normal file
View file

@ -0,0 +1,52 @@
<base href='https://irssi.org/documentation/qna/multi/'>
<h1>Right-aligned nicks</h1>
<p>To create a “tabular” effect of the chat view, or to align nick names in a column, you can use Irssis theme/format system. The basic commands are the following:</p>
<div class="highlight-default notranslate"><div><pre>/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
</pre></div>
</div>
<p>These are copied from the default themes default values, which are responsible for displaying your own messages sent to a channel (<code class="docutils literal notranslate">own_msg</code>) as well as received messages (<code class="docutils literal notranslate">pubmsg</code>) and the two basic highlightings (<code class="docutils literal notranslate">me</code> and <code class="docutils literal notranslate">hilight</code>).</p>
<p>Then, in front of the argument that contains the nick name (<code class="docutils literal notranslate">$0</code> in most cases, but <code class="docutils literal notranslate">$1</code> in <code class="docutils literal notranslate">pubmsg_hilight</code>), an alignment modifier (see <a class="reference internal" href="../../settings/#a-b">Appendix B: Special Variables and Expandos</a>) has been added: <code class="docutils literal notranslate">[-9]</code>. This means that the nicks will be right-aligned and truncated to 9 characters.</p>
<p><strong>Note</strong>: Modifiers <em>only</em> work in the <code class="docutils literal notranslate">/format</code> section of a theme (this may change in the future)</p>
<p>There are also some scripts that try to do the alignment for you, like: <code class="docutils literal notranslate">nm</code>, <code class="docutils literal notranslate">nm2</code>.</p>
<p>There are also some nice themes that extend the alignment to further formats, like: <a class="reference external" href="https://github.com/ronilaukkarinen/weed">weed</a>.</p>
<h1>Automatic log-in to NickServ</h1>
<p>Please check here =&gt; <a class="reference internal" href="../../manual/automation/#automatic-log-in-to-nickserv">Automatic log-in to NickServ</a></p>
<h1>CertFP Log-in</h1>
<p>CertFP, short for Certificate Finger Print, is another method to log you in to NickServ. Instead of a password, it uses a <a class="reference external" href="https://en.wikipedia.org/wiki/Client_certificate">Client Certificate</a>.</p>
<p>In order to use it, you</p>
<ul class="simple">
<li><p>first need a certificate,</p></li>
<li><p>then configure Irssi to use this certificate,</p></li>
<li><p>and finally register the certificate with NickServ.</p></li>
</ul>
<p>Irssi does not have built-in certificate management commands, so you need to use an external tool like <code class="docutils literal notranslate">openssl</code> to create the certificate.</p>
<p>A step-by-step guide for the Libera Chat network can be found here =&gt; <a class="reference external" href="https://github.com/shabble/irssi-docs/wiki/liberachat_certfp">https://github.com/shabble/irssi-docs/wiki/liberachat_certfp</a></p>
<p>It is necessary that the certificate be available as a file; PKCS#11 is not supported.</p>
<h1>Tor (The Onion Router)</h1>
<p><a class="reference external" href="https://www.torproject.org/">Tor</a> is an overlay network for anonymous communication. It operates a local <a class="reference external" href="https://en.wikipedia.org/wiki/SOCKS">SOCKS</a> proxy for applications to use.</p>
<p>Unfortunately, Irssi currently does not support SOCKS proxies natively. As a workaround, you can install the <a class="reference external" href="https://github.com/rofl0r/proxychains-ng">ProxyChains-NG</a> program (note, it must be the NG version).</p>
<p>Afterwards, you can launch Irssi like this:</p>
<div class="highlight-default notranslate"><div><pre>proxychains4 irssi
</pre></div>
</div>
<p>Now your connections will go through the Proxy configured in ProxyChains-NG (Tor by default).</p>
<p>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 <a class="reference internal" href="../certfp/">CertFP Log-in</a> using a clearnet connection, and then connect to their <a class="reference external" href="https://libera.chat/guides/connect#accessing-liberachat-via-tor">Onion Service</a> <code class="docutils literal notranslate">palladium.libera.chat</code>. More detailed instructions can be found here =&gt; <a class="reference external" href="https://github.com/shabble/irssi-docs/wiki/liberator">https://github.com/shabble/irssi-docs/wiki/liberator</a></p>
<h1>The following signatures were invalid: EXPKEYSIG</h1>
<p>If you see such a message</p>
<div class="highlight-default notranslate"><div><pre>Err:4 home:/ailin_nemui:/irssi-an InRelease
The following signatures were invalid: EXPKEYSIG EDB7AED941EEDB57 home:ailin_nemui OBS Project &lt;home:ailin_nemui@build.opensuse.org&gt;
</pre></div>
</div>
<p>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.</p>
<section id="fix">
<h2>Fix</h2>
<p>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 <code class="docutils literal notranslate">/etc/apt/trusted.gpg.d</code> or in <code class="docutils literal notranslate">apt-key list</code> and remove it as well.</p>
</section>

111
docs/qna.txt Normal file
View file

@ -0,0 +1,111 @@
# Right-aligned nicks #
To create a “tabular” effect of the chat view, or to align nick names in a
column, you can use Irssis theme/format system. The basic commands are the
following:
/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
These are copied from the default themes default values, which are responsible
for displaying your own messages sent to a channel (own_msg) as well as
received messages (pubmsg) and the two basic highlightings (me and hilight).
Then, in front of the argument that contains the nick name ($0 in most cases,
but $1 in pubmsg_hilight), an alignment modifier (see [1]Appendix B: Special
Variables and Expandos) has been added: [-9]. This means that the nicks will be
right-aligned and truncated to 9 characters.
Note: Modifiers only work in the /format section of a theme (this may change in
the future)
There are also some scripts that try to do the alignment for you, like: nm,
nm2.
There are also some nice themes that extend the alignment to further formats,
like: [2]weed.
# Automatic log-in to NickServ #
Please check here => [3]Automatic log-in to NickServ
# CertFP Log-in #
CertFP, short for Certificate Finger Print, is another method to log you in to
NickServ. Instead of a password, it uses a [4]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 openssl to create the certificate.
A step-by-step guide for the Libera Chat network can be found here => [5]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 (The Onion Router) #
[6]Tor is an overlay network for anonymous communication. It operates a local
[7]SOCKS proxy for applications to use.
Unfortunately, Irssi currently does not support SOCKS proxies natively. As a
workaround, you can install the [8]ProxyChains-NG program (note, it must be the
NG version).
Afterwards, you can launch Irssi like this:
proxychains4 irssi
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 [9]CertFP Log-in using a
clearnet connection, and then connect to their [10]Onion Service
palladium.libera.chat. More detailed instructions can be found here => [11]
https://github.com/shabble/irssi-docs/wiki/liberator
# The following signatures were invalid: EXPKEYSIG #
If you see such a message
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>
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.
## Fix ##
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 /etc/apt/
trusted.gpg.d or in apt-key list and remove it as well.
References:
[1] https://irssi.org/documentation/settings/#a-b
[2] https://github.com/ronilaukkarinen/weed
[3] https://irssi.org/documentation/manual/automation/#automatic-log-in-to-nickserv
[4] https://en.wikipedia.org/wiki/Client_certificate
[5] https://github.com/shabble/irssi-docs/wiki/liberachat_certfp
[6] https://www.torproject.org/
[7] https://en.wikipedia.org/wiki/SOCKS
[8] https://github.com/rofl0r/proxychains-ng
[9] https://irssi.org/documentation/qna/certfp/
[10] https://libera.chat/guides/connect#accessing-liberachat-via-tor
[11] https://github.com/shabble/irssi-docs/wiki/liberator

View file

@ -94,6 +94,8 @@ $A .. $Z is important.
$winname window name
$itemname like $T, but use item's visible_name which may be
different (eg. $T = !12345chan, $itemname = !chan)
$abiversion IRSSI_ABI_VERSION
https://github.com/irssi/irssi/wiki/irssi_abi_version
For example, assume you have the following alias:

View file

@ -515,12 +515,12 @@ Ctrl-X - set the next server in list active
<p><strong>SOCKS</strong></p>
<p>Irssi can be compiled with socks support (<code>--with-socks</code> option to configure), which requires “dante” and routes all connections through the proxy specified in the system-wide /etc/socks.conf. This method is known to have issues in Mac OS X.</p>
<p>Using <a href="https://github.com/rofl0r/proxychains-ng">proxychains-ng</a> is recommended for using irssi with a socks proxy.</p>
<p>Irssi does not support socks proxy natively.</p>
<p>Note that <code>/SET proxy</code> settings dont have anything to do with socks.</p>
<p>Using <a href="https://github.com/rofl0r/proxychains-ng">proxychains-ng</a> is recommended over recompiling irssi.</p>
<p><strong>Others</strong></p>
<p>IRC bouncers usually work like IRC servers, and want a password. You can give it with:</p>
@ -683,4 +683,4 @@ Ctrl-X - set the next server in list active
/STATUSBAR &lt;name&gt; REMOVE &lt;item&gt;
</code></pre></div></div>
<p>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: <code>/STATUSBAR window ADD -before act mail</code>.</p>
<p>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: <code>/STATUSBAR window ADD -before act mail</code>.</p>

View file

@ -578,15 +578,12 @@ Irssi proxy works fine with other IRC clients as well.
SOCKS
Irssi can be compiled with socks support (--with-socks option to configure),
which requires “dante” and routes all connections through the proxy specified
in the system-wide /etc/socks.conf. This method is known to have issues in Mac
OS X.
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 dont have anything to do with socks.
Using [4]proxychains-ng is recommended over recompiling irssi.
Others
IRC bouncers usually work like IRC servers, and want a password. You can give

View file

@ -1,20 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
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@"
Name: Irssi
Description: Irssi chat client
Version: @PACKAGE_VERSION@
Cflags: -I${includedir} @OPENSSL_CFLAGS@
Requires: glib-2.0

View file

@ -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 <glib.h>
#include <stdio.h>
#include <stdlib.h>
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, &micro) != 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 <glib.h>
#include <stdio.h>
], [ 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
])

View file

@ -1,28 +0,0 @@
dnl GLIB_TESTS
dnl
AC_DEFUN([GLIB_TESTS],
[
AC_ARG_ENABLE(installed-tests,
AS_HELP_STRING([--enable-installed-tests],
[Enable installation of some test cases]),
[case ${enableval} in
yes) ENABLE_INSTALLED_TESTS="1" ;;
no) ENABLE_INSTALLED_TESTS="" ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-installed-tests]) ;;
esac])
AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], test "$ENABLE_INSTALLED_TESTS" = "1")
AC_ARG_ENABLE(always-build-tests,
AS_HELP_STRING([--enable-always-build-tests],
[Enable always building tests during 'make all']),
[case ${enableval} in
yes) ENABLE_ALWAYS_BUILD_TESTS="1" ;;
no) ENABLE_ALWAYS_BUILD_TESTS="" ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-always-build-tests]) ;;
esac])
AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], test "$ENABLE_ALWAYS_BUILD_TESTS" = "1")
if test "$ENABLE_INSTALLED_TESTS" = "1"; then
AC_SUBST(installed_test_metadir, [${datadir}/installed-tests/]AC_PACKAGE_NAME)
AC_SUBST(installed_testdir, [${libexecdir}/installed-tests/]AC_PACKAGE_NAME)
fi
])

View file

@ -1,143 +0,0 @@
# libgcrypt.m4 - Autoconf macros to detect libgcrypt
# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This file is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Last-changed: 2014-10-02
dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION,
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
dnl Test for libgcrypt and define LIBGCRYPT_CFLAGS and LIBGCRYPT_LIBS.
dnl MINIMUN-VERSION is a string with the version number optionalliy prefixed
dnl with the API version to also check the API compatibility. Example:
dnl a MINIMUN-VERSION of 1:1.2.5 won't pass the test unless the installed
dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using
dnl this features allows to prevent build against newer versions of libgcrypt
dnl with a changed API.
dnl
dnl If a prefix option is not used, the config script is first
dnl searched in $SYSROOT/bin and then along $PATH. If the used
dnl config script does not match the host specification the script
dnl is added to the gpg_config_script_warn variable.
dnl
AC_DEFUN([AM_PATH_LIBGCRYPT],
[ AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_WITH(libgcrypt-prefix,
AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
[prefix where LIBGCRYPT is installed (optional)]),
libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
if test x"${LIBGCRYPT_CONFIG}" = x ; then
if test x"${libgcrypt_config_prefix}" != x ; then
LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
else
case "${SYSROOT}" in
/*)
if test -x "${SYSROOT}/bin/libgcrypt-config" ; then
LIBGCRYPT_CONFIG="${SYSROOT}/bin/libgcrypt-config"
fi
;;
'')
;;
*)
AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
;;
esac
fi
fi
AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
tmp=ifelse([$1], ,1:1.2.0,$1)
if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
min_libgcrypt_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
else
req_libgcrypt_api=0
min_libgcrypt_version="$tmp"
fi
AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
ok=no
if test "$LIBGCRYPT_CONFIG" != "no" ; then
req_major=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
req_minor=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
req_micro=`echo $min_libgcrypt_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
major=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
minor=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
micro=`echo $libgcrypt_config_version | \
sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
if test "$major" -gt "$req_major"; then
ok=yes
else
if test "$major" -eq "$req_major"; then
if test "$minor" -gt "$req_minor"; then
ok=yes
else
if test "$minor" -eq "$req_minor"; then
if test "$micro" -ge "$req_micro"; then
ok=yes
fi
fi
fi
fi
fi
fi
if test $ok = yes; then
AC_MSG_RESULT([yes ($libgcrypt_config_version)])
else
AC_MSG_RESULT(no)
fi
if test $ok = yes; then
# If we have a recent libgcrypt, we should also check that the
# API is compatible
if test "$req_libgcrypt_api" -gt 0 ; then
tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
if test "$tmp" -gt 0 ; then
AC_MSG_CHECKING([LIBGCRYPT API version])
if test "$req_libgcrypt_api" -eq "$tmp" ; then
AC_MSG_RESULT([okay])
else
ok=no
AC_MSG_RESULT([does not match. want=$req_libgcrypt_api got=$tmp])
fi
fi
fi
fi
if test $ok = yes; then
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
ifelse([$2], , :, [$2])
libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
if test x"$libgcrypt_config_host" != xnone ; then
if test x"$libgcrypt_config_host" != x"$host" ; then
AC_MSG_WARN([[
***
*** The config script $LIBGCRYPT_CONFIG was
*** built for $libgcrypt_config_host and thus may not match the
*** used host $host.
*** You may want to use the configure option --with-libgcrypt-prefix
*** to specify a matching config script or use \$SYSROOT.
***]])
gpg_config_script_warn="$gpg_config_script_warn libgcrypt"
fi
fi
else
LIBGCRYPT_CFLAGS=""
LIBGCRYPT_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(LIBGCRYPT_CFLAGS)
AC_SUBST(LIBGCRYPT_LIBS)
])

View file

@ -1,134 +0,0 @@
dnl
dnl Off-the-Record Messaging library
dnl Copyright (C) 2004-2007 Ian Goldberg, Chris Alexander, Nikita Borisov
dnl <otr@cypherpunks.ca>
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of version 2.1 of the GNU Lesser General
dnl Public License as published by the Free Software Foundation.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
dnl
dnl AM_PATH_LIBOTR([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for libotr, and define LIBOTR_CFLAGS and LIBOTR_LIBS as appropriate.
dnl enables arguments --with-libotr-prefix=
dnl --with-libotr-inc-prefix=
dnl
dnl You must already have found libgcrypt with AM_PATH_LIBGCRYPT
dnl
dnl Adapted from alsa.m4, originally by
dnl Richard Boulton <richard-alsa@tartarus.org>
dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
dnl Jaroslav Kysela <perex@suse.cz>
AC_DEFUN([AM_PATH_LIBOTR],
[dnl Save the original CFLAGS, LDFLAGS, and LIBS
libotr_save_CFLAGS="$CFLAGS"
libotr_save_LDFLAGS="$LDFLAGS"
libotr_save_LIBS="$LIBS"
libotr_found=yes
dnl
dnl Get the cflags and libraries for libotr
dnl
AC_ARG_WITH(libotr-prefix,
[ --with-libotr-prefix=PFX Prefix where libotr is installed(optional)],
[libotr_prefix="$withval"], [libotr_prefix=""])
AC_ARG_WITH(libotr-inc-prefix,
[ --with-libotr-inc-prefix=PFX Prefix where libotr includes are (optional)],
[libotr_inc_prefix="$withval"], [libotr_inc_prefix=""])
dnl Add any special include directories
AC_MSG_CHECKING(for libotr CFLAGS)
if test "$libotr_inc_prefix" != "" ; then
LIBOTR_CFLAGS="$LIBOTR_CFLAGS -I$libotr_inc_prefix"
CFLAGS="$CFLAGS $LIBOTR_CFLAGS"
fi
AC_MSG_RESULT($LIBOTR_CFLAGS)
dnl add any special lib dirs
AC_MSG_CHECKING(for libotr LIBS)
if test "$libotr_prefix" != "" ; then
LIBOTR_LIBS="$LIBOTR_LIBS -L$libotr_prefix"
LDFLAGS="$LDFLAGS $LIBOTR_LIBS"
fi
dnl add the libotr library
LIBOTR_LIBS="$LIBOTR_LIBS -lotr"
LIBS="$LIBOTR_LIBS $LIBS"
AC_MSG_RESULT($LIBOTR_LIBS)
dnl Check for a working version of libotr that is of the right version.
min_libotr_version=ifelse([$1], ,3.0.0,$1)
no_libotr=""
libotr_min_major_version=`echo $min_libotr_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
libotr_min_minor_version=`echo $min_libotr_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
libotr_min_sub_version=`echo $min_libotr_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
AC_MSG_CHECKING(for libotr headers version $libotr_min_major_version.x >= $min_libotr_version)
AC_LANG_SAVE
AC_LANG_C
AC_TRY_COMPILE([
#include <stdlib.h>
#include <libotr/version.h>
], [
# if(OTRL_VERSION_MAJOR != $libotr_min_major_version)
# error not present
# else
# if(OTRL_VERSION_MINOR > $libotr_min_minor_version)
exit(0);
# else
# if(OTRL_VERSION_MINOR < $libotr_min_minor_version)
# error not present
# endif
# if(OTRL_VERSION_SUB < $libotr_min_sub_version)
# error not present
# endif
# endif
# endif
exit(0);
],
[AC_MSG_RESULT(found.)],
[AC_MSG_RESULT(not present.)
ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libotr not found.)])
libotr_found=no]
)
AC_LANG_RESTORE
dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
AC_CHECK_LIB([otr], [otrl_message_receiving],,
[ifelse([$3], , [AC_MSG_ERROR(No linkable libotr was found.)])
libotr_found=no],
$LIBGCRYPT_LIBS
)
LDFLAGS="$libotr_save_LDFLAGS"
LIBS="$libotr_save_LIBS"
if test "x$libotr_found" = "xyes" ; then
ifelse([$2], , :, [$2])
else
LIBOTR_CFLAGS=""
LIBOTR_LIBS=""
ifelse([$3], , :, [$3])
fi
dnl That should be it. Now just export our symbols:
AC_SUBST(LIBOTR_CFLAGS)
AC_SUBST(LIBOTR_LIBS)
])

275
m4/pkg.m4
View file

@ -1,275 +0,0 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR

View file

@ -1,84 +1,115 @@
project('irssi', 'c',
version : '1.4.5',
meson_version : '>=0.49',
default_options : ['warning_level=1'])
project(
'irssi',
'c',
version : '1.5-head',
meson_version : '>=0.53',
default_options : [ 'warning_level=1' ],
)
############################
############################
glib_internal_version = 'glib-2.58.3' # keep this in sync with subprojects/glib.wrap
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 = []
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)
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')
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'
want_truecolor = get_option('enable-true-color') == 'yes'
want_gregex = get_option('disable-gregex') != 'yes'
want_proxy = get_option('with-proxy') == 'yes'
require_capsicum = get_option('with-capsicum') == 'yes'
want_capsicum = get_option('with-capsicum') != 'no'
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'
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_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'
require_otr = get_option('with-otr') == 'yes'
want_otr = get_option('with-otr') != 'no'
want_glib_internal = get_option('install-glib') != '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()
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]
UNSET_ARR = [ UNSET ]
chat_modules = ['irc']
chat_modules = [ 'irc' ]
run_command('mkdir', meson.current_build_dir() / incdir)
run_command('ln', '-s', meson.current_source_dir() / 'src', meson.current_build_dir() / incdir)
run_command('ln', '-s', meson.current_build_dir() / 'irssi-config.h', meson.current_build_dir() / incdir)
run_command('ln', '-s', meson.current_build_dir() / 'irssi-version.h', meson.current_build_dir() / incdir)
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_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_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 = []
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())
if [ 'darwin', 'ios' ].contains(host_machine.system())
module_suffix = 'so'
perl_module_suffix = 'bundle'
endif
@ -87,13 +118,20 @@ endif
# Help files #
##############
build_perl = find_program('perl', native : true)
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'))
run_command(
build_perl,
files('utils/syntax.pl'),
check : true,
)
###################
# irssi-version.h #
@ -101,12 +139,12 @@ run_command(build_perl, files('utils/syntax.pl'))
env = find_program('env')
irssi_version_sh = find_program('utils/irssi-version.sh')
irssi_version_h = custom_target('irssi-version.h',
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()],
command : [ env, 'VERSION=' + meson.project_version(), irssi_version_sh, meson.current_source_dir() ],
output : 'irssi-version.h',
install : true,
install_dir : includedir / incdir,
@ -117,22 +155,24 @@ irssi_version_h = custom_target('irssi-version.h',
####################
file2header = find_program('utils/file2header.sh')
default_config_h = custom_target('default-config.h',
default_config_h = custom_target(
'default-config.h',
input : files('irssi.conf'),
output : 'default-config.h',
capture : true,
command : [file2header, '@INPUT@', 'default_config'],
command : [ file2header, '@INPUT@', 'default_config' ],
)
###################
# default-theme.h #
###################
default_theme_h = custom_target('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'],
command : [ file2header, '@INPUT@', 'default_theme' ],
)
################
@ -141,12 +181,18 @@ default_theme_h = custom_target('default-theme.h',
#### inet_addr ####
inet_addr_found = false
foreach inet_addr_provider : ['', 'nsl']
prov_lib = []
foreach inet_addr_provider : [ '', 'nsl' ]
prov_lib = [ ]
if inet_addr_provider != ''
prov_lib += cc.find_library(inet_addr_provider, required : false)
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)
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
@ -158,12 +204,18 @@ endif
#### socket ####
socket_found = false
foreach socket_provider : ['', 'socket', 'network']
prov_lib = []
foreach socket_provider : [ '', 'socket', 'network' ]
prov_lib = [ ]
if socket_provider != ''
prov_lib += cc.find_library(socket_provider, required : false)
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)
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
@ -173,7 +225,7 @@ if not socket_found
error('socket not found')
endif
built_src = []
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')
@ -181,59 +233,82 @@ 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')
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)
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',
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'],
output : [ 'glib-internal-download' ],
)
glib_internal_dependencies = [
dependency('threads'),
]
glib_internal_configure_args = []
glib_internal_configure_args = [ ]
glib_internal_usr_local = false
if not cc.has_function('iconv_open')
prov_lib = cc.find_library('iconv', required : false)
prov_lib = cc.find_library(
'iconv',
required : false,
)
if not prov_lib.found()
prov_lib = cc.find_library('iconv', dirs : '/usr/local/lib')
prov_lib = cc.find_library(
'iconv',
dirs : '/usr/local/lib',
)
glib_internal_usr_local = true
endif
if cc.has_function('libiconv_open', dependencies : prov_lib)
glib_internal_configure_args += '-Diconv=gnu'
else
glib_internal_configure_args += '-Diconv=native'
endif
glib_internal_dependencies += prov_lib
endif
if not cc.has_function('ngettext')
prov_lib = cc.find_library('intl', required : false)
prov_lib = cc.find_library(
'intl',
required : false,
)
if not prov_lib.found()
prov_lib = cc.find_library('intl', dirs : '/usr/local/lib')
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']
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)
prov_lib = cc.find_library(
'xattr',
required : false,
)
else
prov_lib = dependency('', required : false)
prov_lib = dependency(
'',
required : false,
)
endif
if prov_lib.found()
glib_internal_dependencies += prov_lib
@ -242,23 +317,41 @@ if not glib_dep.found()
endif
endif
glib_internal_configure_t = custom_target('glib-internal-configure',
command : [ meson_cmd, 'setup', '--prefix=/irssi-glib-internal',
glib_internal_configure_t = custom_target(
'glib-internal-configure',
command : [
meson_cmd,
'setup',
'--prefix=/irssi-glib-internal',
'--buildtype=' + get_option('buildtype'),
'-Dlibmount=false', '-Dselinux=false', '-Ddefault_library=static', '-Dinternal_pcre=true',
'-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) ],
(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',
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'],
'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,)
output : [ 'glib-internal-build' ],
depends : glib_internal_configure_t,
)
glib_dep = declare_dependency(
dependencies : glib_internal_dependencies,
sources : glib_internal_build_t,
@ -267,32 +360,84 @@ if not glib_dep.found()
'-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' / 'glib' / 'libglib-2.0.a' ],
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 = 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,
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')
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_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')
openssl_dep = dependency(
'openssl',
static : want_static_dependency,
include_type : 'system',
)
endif
dep += openssl_dep
@ -301,10 +446,16 @@ dep += openssl_dep
############
have_libutf8proc = false
libutf8proc = []
libutf8proc = [ ]
if want_libutf8proc
libutf8proc = cc.find_library('utf8proc', required : require_libutf8proc)
have_libutf8proc = cc.has_function('utf8proc_version', dependencies : libutf8proc)
libutf8proc = cc.find_library(
'utf8proc',
required : require_libutf8proc,
)
have_libutf8proc = cc.has_function(
'utf8proc_version',
dependencies : libutf8proc,
)
if have_libutf8proc
dep += libutf8proc
endif
@ -319,9 +470,15 @@ endif
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)
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
@ -338,15 +495,20 @@ endif
have_perl = false
if want_perl
perl_cflags = []
perl_ldflags = []
perl_rpath_flags = []
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')
res = run_command(
cross_perl,
'-MExtUtils::Embed',
'-e', 'ccopts',
check : true,
)
perl_ccopts = res.stdout().strip().split()
endif
foreach fl : perl_ccopts
@ -363,10 +525,15 @@ if want_perl
#### 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')
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']
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,')
@ -380,18 +547,26 @@ if want_perl
perl_version = meson.get_cross_property('perl_version', UNSET)
if perl_version == UNSET
perl_version = run_command(cross_perl, '-V::version:').stdout().split('\'')[1]
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)
perl_dep = declare_dependency(
compile_args : perl_cflags,
link_args : perl_ldflags,
version : perl_version,
)
####
if not cc.links('''
if not cc.links(
'''
#include <EXTERN.h>
#include <perl.h>
int main()
@ -399,8 +574,10 @@ int main()
perl_alloc();
return 0;
}
''', args : perl_cflags + perl_ldflags + perl_rpath_flags,
name : 'working Perl support')
''',
args : perl_cflags + perl_ldflags + perl_rpath_flags,
name : 'working Perl support',
)
if require_perl
error('error linking with perl libraries')
else
@ -409,9 +586,15 @@ int main()
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').stdout()
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,
xsubpp = generator(
build_perl,
output : '@BASENAME@.c',
capture : true,
arguments : [ xsubpp_file_c, '@EXTRA_ARGS@', '@INPUT@' ],
@ -419,31 +602,44 @@ int main()
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}').stdout()
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:/']
if get_option('prefix') in [ '/usr/local', 'C:/' ]
with_perl_lib = 'site'
elif get_option('prefix') in ['/usr']
elif get_option('prefix') in [ '/usr' ]
with_perl_lib = 'vendor'
endif
endif
perlmoddir = ''
if with_perl_lib in ['site', 'vendor', 'module']
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']
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:').stdout().split('\'')[1]
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:').stdout().split('\'')[1]
perl_archname = run_command(
cross_perl,
'-V::archname:',
check : true,
).stdout().split('\'')[1]
endif
perlmoddir = perl_install_base / 'lib' / 'perl5' / perl_archname
endif
@ -464,7 +660,12 @@ int main()
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).returncode() != 0
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
@ -490,8 +691,20 @@ endif
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')
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
@ -505,9 +718,19 @@ endif
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 <sys/nv.h>')
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 <sys/nv.h>',
)
if nvlist_create_found
dep += libnv
have_capsicum = true
@ -524,11 +747,14 @@ if want_capsicum
endif
# dependency helper sets
dep_cflagsonly = []
dep_cflagsonly = [ ]
foreach d : dep
dep_cflagsonly += d.partial_dependency(includes : true, compile_args : true)
dep_cflagsonly += d.partial_dependency(
includes : true,
compile_args : true,
)
endforeach
dl_cross_dep = []
dl_cross_dep = [ ]
if need_dl_cross_link
dl_cross_dep = dep
endif
@ -539,12 +765,19 @@ endif
conf = configuration_data()
conf.set('HAVE_CAPSICUM', have_capsicum, description : 'Build with Capsicum support')
conf.set(
'HAVE_CAPSICUM',
have_capsicum,
description : 'Build with Capsicum support',
)
conf.set('HAVE_GMODULE', true)
conf.set('HAVE_SOCKS', false, description : 'Build with socks support')
conf.set('TERM_TRUECOLOR', want_truecolor, description : 'true color support in terminal')
conf.set('USE_GREGEX', want_gregex, description : 'use GRegex for regular expressions')
conf.set10('_DARWIN_USE_64_BIT_INODE', true, description : 'Enable large inode numbers on Mac OS X 10.5.')
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 = [
@ -558,29 +791,110 @@ headers = [
]
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.')
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 <stdio.h>
#include <term.h>
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 <curses.h>
#include <term.h>
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 <curses.h>
#include <term.h>
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',
configure_file(
output : 'irssi-config.h',
configuration : conf,
install_dir : includedir / incdir)
install_dir : includedir / incdir,
)
##########
# CFLAGS #
##########
#### warnings ####
add_project_arguments(cc.get_supported_arguments('-Werror=declaration-after-statement'), language : 'c')
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')
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')
add_project_arguments(
cc.get_supported_arguments('-fno-omit-frame-pointer'),
language : 'c',
)
endif
if want_fuzzer
@ -588,7 +902,10 @@ if want_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')
add_project_arguments(
'-fsanitize=fuzzer-no-link',
language : 'c',
)
endif
if fuzzer_link_language != 'c'
add_languages(fuzzer_link_language)
@ -600,7 +917,7 @@ endif
##############
pc = import('pkgconfig')
pc_requires = []
pc_requires = [ ]
if not glib_internal
pc_requires += glib_dep
endif
@ -615,15 +932,14 @@ if signalsfile.startswith('/')
else
signalsfile = '${prefix}' / signalsfile
endif
pc.generate(filebase : 'irssi-1',
pc.generate(
filebase : 'irssi-1',
name : 'Irssi',
description : 'Irssi chat client',
version : package_version,
requires : pc_requires,
variables : [
'irssimoduledir=${libdir}' / incdir / 'modules',
'signalsfile=' + signalsfile
])
variables : [ 'irssimoduledir=${libdir}' / incdir / 'modules', 'signalsfile=' + signalsfile ],
)
###########
# irssi.1 #
@ -663,8 +979,6 @@ if have_perl
endif
message('Install prefix ................... : ' + get_option('prefix'))
message('')
message('Building with true color support.. : ' + want_truecolor.to_string('yes', 'no'))
message('Building with GRegex ............. : ' + want_gregex.to_string('yes', 'no'))
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'))

View file

@ -7,8 +7,6 @@ option('with-proxy', type : 'combo', description : 'Build irssi-proxy',
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('enable-true-color', type : 'combo', description : 'Build with true color support in terminal', choices : ['no', 'yes'])
option('disable-gregex', type : 'combo', description : 'Build without GRegex (fall back to regex.h)', choices : ['no', 'yes'])
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'])

View file

@ -1,18 +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) \
meson.build

View file

@ -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 = <CONF>) {
if ($line !=~ /^\s*$/) {
cmd_autoop($line);
$count++;
}
chomp($line);
if ($line !~ /^\s*$/) {
cmd_autoop($line);
$count++;
}
}
close(CONF);

View file

@ -1,8 +0,0 @@
scriptdir = $(datadir)/irssi/scripts
script_DATA = \
command.pl \
msg-event.pl \
redirect.pl
EXTRA_DIST = $(script_DATA)

View file

@ -1,6 +1,6 @@
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",
@ -63,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".

View file

@ -11,4 +11,5 @@ install_data(
'scriptassist.pl',
'usercount.pl',
),
install_dir : scriptdir)
install_dir : scriptdir,
)

View file

@ -5,7 +5,7 @@
use strict;
our $VERSION = '2022053100';
our $VERSION = '2023111700';
our %IRSSI = (
authors => 'Stefan \'tommie\' Tomanek',
contact => 'stefan@pico.ruhr.de',
@ -22,6 +22,8 @@ our ($forked, %remote_db, $have_gpg, @complist);
use Irssi 20020324;
use CPAN::Meta::YAML;
use LWP::UserAgent;
use Hash::Util qw(lock_ref_keys);
use JSON::PP;
use POSIX;
use version;
@ -43,7 +45,7 @@ sub show_help {
/scriptassist info <scripts>
Display information about <scripts>
/scriptassist ratings <scripts|all>
Retrieve the average ratings of the the scripts
Retrieve the average ratings of the scripts
/scriptassist top <num>
Retrieve the first <num> top rated scripts
/scriptassist new <num>
@ -199,87 +201,163 @@ sub get_unknown {
}
sub get_names {
my ($sname, $db) = shift;
my ($sname, $db, $votes) = @_;
$sname =~ s/\s+$//;
$sname =~ s/\.pl$//;
my $plname = "$sname.pl";
my $ext = 'pl'; # default extension
if ($sname =~ s/\.(\w{2,3})$//) {
$ext = $1;
}
my $plname = "$sname.$ext";
$sname =~ s/^.*\///;
my $xname = $sname;
$xname =~ s/\W/_/g;
my $pname = "${xname}::";
if ($xname ne $sname || $sname =~ /_/) {
my $dir = Irssi::get_irssi_dir()."/scripts/";
if ($db && exists $db->{"$sname.pl"}) {
if ($db && exists $db->{$plname}) {
# $found = 1;
} elsif (-e $dir.$plname || -e $dir."$sname.pl" || -e $dir."autorun/$sname.pl") {
} elsif (-e $dir.$plname || -e $dir."autorun/".$plname) {
# $found = 1;
} else {
# not found
my $pat = $xname; $pat =~ y/_/?/;
my $re = "\Q$xname"; $re =~ s/\Q_/./g;
if ($db) {
my ($cand) = grep /^$re\.pl$/, sort keys %$db;
my ($cand) = grep /^$re\.\Q$ext\E$/, sort keys %$db;
if ($cand) {
return get_names($cand, $db);
return get_names($cand, $db, $votes);
}
}
my ($cand) = glob "'$dir$pat.pl' '${dir}autorun/$pat.pl'";
my ($cand) = glob "'$dir$pat.$ext' '${dir}autorun/$pat.$ext'";
if ($cand) {
$cand =~ s/^.*\///;
return get_names($cand, $db);
return get_names($cand, $db, $votes);
}
}
}
($sname, $plname, $pname, $xname)
my ($script_stash, $script_irssi, $script_db, $local_version);
$script_db = $db->{$plname} if $db && exists $db->{$plname};
if (lc $ext eq 'pl') {
$script_stash = $Irssi::Script::{$pname};
}
elsif (lc $ext eq 'py' && is_python_loaded()) {
my $filename;
capture_print_text_command(
'py list',
sub {
for my $line (@_[ 1 .. $#_ ]) {
my ($script, $fn) = split ' ', $line, 2;
if ($script eq $sname) {
$filename = $fn;
}
}
});
if (defined $filename) {
my $filename_quoted = $filename;
$filename_quoted =~ s/[\\']/\\$&/g;
capture_print_text_command(
# make sure the command line stays short
'py exec ' .
(join ';', split /\n/, <<PYTHON
import ast as A, types as _, json
i = 'IRSSI'
v = '__version__'
T = isinstance
f = '$filename_quoted'
a = lambda _: T(_, A.Assign)
n = lambda _: T(_, A.Name)
y = lambda _: _.id
t = lambda _: list(map(y, filter(n, _.targets)))
C = lambda e: lambda _: a(_) and t(_) == [e]
O = _.SimpleNamespace(value=A.Constant(None))
P = A.parse(open(f).read(), filename=f)
f = lambda e: A.literal_eval(next(filter(C(e), P.body), O).value)
print(json.dumps({ i: f(i), v: f(v) }))
PYTHON
),
sub {
eval {
my $doc = decode_json("@_");
$script_stash = { IRSSI => $doc->{IRSSI}, VERSION => \($doc->{__version__}) };
};
}
);
}
}
if (defined $script_stash) {
$script_irssi = $script_stash->{IRSSI};
$local_version = ${$script_stash->{VERSION}}
if $script_stash->{VERSION};
}
lock_ref_keys({
sname => $ext eq 'pl' ? $sname : $plname,
plname => $plname,
pname => $pname,
xname => $xname,
stash => $script_stash,
irssi => $script_irssi,
db => $script_db,
db_version => ($script_db ? $script_db->{version} : undef),
local_version => $local_version,
($votes ? (votes => $votes->{$plname}) : ()),
})
}
sub script_info {
my ($scripts) = @_;
my %result;
my $xml = get_scripts();
my $py = is_python_loaded();
foreach (@{$scripts}) {
my ($sname, $plname, $pname) = get_names($_, $xml);
next unless (defined $xml->{$plname} || ( exists $Irssi::Script::{$pname} && exists $Irssi::Script::{$pname}{IRSSI} ));
$result{$sname}{version} = get_remote_version($sname, $xml);
my %r;
my $n = get_names($_, $xml);
next unless (defined $n->{db} || defined $n->{irssi});
$r{version} = $n->{db_version};
my @headers = ('authors', 'contact', 'description', 'license', 'source');
foreach my $entry (@headers) {
$result{$sname}{$entry} = $Irssi::Script::{$pname}{IRSSI}{$entry};
if (defined $xml->{$plname}{$entry}) {
$result{$sname}{$entry} = $xml->{$plname}{$entry};
$r{$entry} = $n->{irssi}{$entry};
if ($n->{db} && defined $n->{db}{$entry}) {
$r{$entry} = $n->{db}{$entry};
}
}
if ($xml->{$plname}{signature_available}) {
$result{$sname}{signature_available} = 1;
if ($n->{db} && $n->{db}{signature_available}) {
$r{signature_available} = 1;
}
if (defined $xml->{$plname}{modules}) {
my $modules = $xml->{$plname}{modules};
if ($n->{db} && defined $n->{db}{modules}) {
my $modules = $n->{db}{modules};
foreach my $mod (split(/ /, $modules)) {
my $opt = ($mod =~ /\((.*)\)/)? 1 : 0;
$mod = $1 if $1;
$result{$sname}{modules}{$mod}{optional} = $opt;
$result{$sname}{modules}{$mod}{installed} = module_exist($mod);
$r{modules}{$mod}{optional} = $opt;
$r{modules}{$mod}{installed} = module_exist($mod);
}
} elsif (defined $Irssi::Script::{$pname}{IRSSI}{modules}) {
my $modules = $Irssi::Script::{$pname}{IRSSI}{modules};
} elsif ($n->{irssi} && defined $n->{irssi}{modules}) {
my $modules = $n->{irssi}{modules};
foreach my $mod (split(/ /, $modules)) {
my $opt = ($mod =~ /\((.*)\)/)? 1 : 0;
$mod = $1 if $1;
$result{$sname}{modules}{$mod}{optional} = $opt;
$result{$sname}{modules}{$mod}{installed} = module_exist($mod);
$r{modules}{$mod}{optional} = $opt;
$r{modules}{$mod}{installed} = module_exist($mod);
}
}
# if (defined $xml->{$plname}{depends}) {
# my $depends = $xml->{$plname}{depends};
if (!$py && $n->{db} && $n->{db}{language} eq 'Python') { # py
$r{modules}{'irssi-python module'}{installed} = 0;
}
# if (defined $n->{db}{depends}) {
# my $depends = $n->{db}{depends};
# foreach my $dep (split(/ /, $depends)) {
# $result{$sname}{depends}{$dep}{installed} = 1; #(defined ${ 'Irssi::Script::'.$dep });
# $r{depends}{$dep}{installed} = 1; #(defined ${ 'Irssi::Script::'.$dep });
# }
# }
$result{$n->{sname}} = \%r;
}
return \%result;
}
sub get_rate_url {
my ($src) = @_;
if (ref $src) { ($src) = grep { $_ } map { $_->{source} } values %$src; }
die("No script source address found\n") unless $src;
my $ua = LWP::UserAgent->new(env_proxy=>1, keep_alive=>1, timeout=>30);
$ua->agent('ScriptAssist/'.$VERSION);
my $request = HTTP::Request->new('GET', $src);
@ -288,6 +366,9 @@ sub get_rate_url {
my $error = join "\n", $response->status_line(), (grep / at .* line \d+/, split "\n", $response->content()), '';
die("Fetching ratings location failed: $error");
}
if (my $error = $response->header('X-Died')) {
die("$error\n");
}
my $votes_url;
for my $tag ($response->content() =~ /<script([^>]*)>/g) {
my $attr = " $tag ";
@ -299,7 +380,7 @@ sub get_rate_url {
}
$request = HTTP::Request->new('GET', $votes_url);
$response = $ua->request($request);
if (!$response->is_success) {
if (!$response->is_success || $response->header('X-Died')) {
my $error = join "\n", $response->status_line(), (grep / at .* line \d+/, split "\n", $response->content()), '';
die("Fetching ratings failed: $error");
}
@ -311,16 +392,16 @@ sub get_rate_url {
sub rate_script {
my ($script, $stars) = @_;
my $xml = get_scripts();
my $votes = get_rate_url(map { $_->{source} } values %$xml);
my ($sname, $plname, $pname) = get_names($script, $xml);
die "Script $script not found\n" unless $votes->{$plname};
return $votes->{$plname}{u}
my $votes = get_rate_url($xml);
my $n = get_names($script, $xml, $votes);
die "Script $script not found\n" unless $n->{votes};
return $n->{votes}{u}
}
sub get_ratings {
my ($scripts, $limit) = @_;
my $xml = get_scripts();
my $votes = get_rate_url(map { $_->{source} } values %$xml);
my $votes = get_rate_url($xml);
foreach (keys %{$votes}) {
if ($xml->{$_}) {
$xml->{$_}{votes} = $votes->{$_}{v};
@ -329,9 +410,9 @@ sub get_ratings {
my %result;
if (@{$scripts}) {
foreach (@{$scripts}) {
my ($sname, $plname, $pname) = get_names($_, $xml);
next unless (defined $xml->{$plname} || ( exists $Irssi::Script::{$pname} && exists $Irssi::Script::{$pname}{IRSSI} ));
$result{$plname} = [$xml->{$plname}{votes}];
my $n = get_names($_, $xml);
next unless ($n->{db} || $n->{irssi});
$result{$n->{plname}} = [$n->{db}{votes}];
}
} else {
my @keys = sort { $xml->{$b}{votes} <=> $xml->{$a}{votes}
@ -371,16 +452,22 @@ sub debug_scripts {
my ($scripts) = @_;
my %result;
my $xml = get_scripts();
my $py = is_python_loaded();
foreach (@{$scripts}) {
my ($sname, $plname) = get_names($_, $xml);
if (defined $xml->{$plname}{modules}) {
my $modules = $xml->{$plname}{modules};
my %r;
my $n = get_names($_, $xml);
if ($n->{db} && defined $n->{db}{modules}) {
my $modules = $n->{db}{modules};
foreach my $mod (split(/ /, $modules)) {
my $opt = ($mod =~ /\((.*)\)/)? 1 : 0;
$mod = $1 if $1;
$result{$sname}{$mod}{optional} = $opt;
$result{$sname}{$mod}{installed} = module_exist($mod);
$r{$mod}{optional} = $opt;
$r{$mod}{installed} = module_exist($mod);
}
$result{$n->{sname}} = \%r;
}
if (!$py && $n->{db} && $n->{db}{language} eq 'Python') { # py
$result{$n->{sname}}{'irssi-python module'}{installed} = 0;
}
}
return(\%result);
@ -391,11 +478,11 @@ sub install_scripts {
my %success;
my $dir = Irssi::get_irssi_dir()."/scripts/";
foreach (@{$scripts}) {
my ($sname, $plname, $pname) = get_names($_, $xml);
if (get_local_version($sname) && (-e $dir.$plname)) {
$success{$sname}{installed} = -2;
my $n = get_names($_, $xml);
if ($n->{stash} && (-e $dir.$n->{plname})) {
$success{$n->{sname}}{installed} = -2;
} else {
$success{$sname} = download_script($sname, $xml);
$success{$n->{sname}} = download_script($n->{sname}, $xml);
}
}
return \%success;
@ -406,24 +493,24 @@ sub update_scripts {
$list = loaded_scripts() if ($list->[0] eq "all" || scalar(@$list) == 0);
my %status;
foreach (@{$list}) {
my ($sname) = get_names($_, $database);
my $local = get_local_version($sname);
my $remote = get_remote_version($sname, $database);
my $n = get_names($_, $database);
my $local = $n->{local_version};
my $remote = $n->{db_version};
next if $local eq '' || $remote eq '';
if (compare_versions($local, $remote) eq "older") {
$status{$sname} = download_script($sname, $database);
$status{$n->{sname}} = download_script($n->{sname}, $database);
} else {
$status{$sname}{installed} = -2;
$status{$n->{sname}}{installed} = -2;
}
$status{$sname}{remote} = $remote;
$status{$sname}{local} = $local;
$status{$n->{sname}}{remote} = $remote;
$status{$n->{sname}}{local} = $local;
}
return \%status;
}
sub search_scripts {
my ($query, $database) = @_;
$query =~ s/\.pl\Z//;
$query =~ s/\.pl\Z//; # pl
my %result;
foreach (sort keys %{$database}) {
my %entry = %{$database->{$_}};
@ -432,7 +519,7 @@ sub search_scripts {
$string .= $entry{description} if defined $entry{description};
if ($string =~ /$query/i) {
my $name = $_;
$name =~ s/\.pl$//;
$name =~ s/\.pl$//; # pl
if (defined $entry{description}) {
$result{$name}{desc} = $entry{description};
} else {
@ -443,7 +530,7 @@ sub search_scripts {
} else {
$result{$name}{authors} = "";
}
if (get_local_version($name)) {
if (get_names($name, $database)->{stash}) {
$result{$name}{installed} = 1;
} else {
$result{$name}{installed} = 0;
@ -531,8 +618,8 @@ sub print_unknown {
my $text .= "The command '/".$cmd."' is provided by the script '".$data->{$cmd}{$_}{name}."'.\n";
$text .= "This script is currently not installed on your system.\n";
$text .= "If you want to install the script, enter\n";
my ($name) = get_names($_);
$text .= " %U/script install ".$name."%U ";
my $n = get_names($_);
$text .= " %U/script install ".$n->{sname}."%U ";
my $output = draw_box("ScriptAssist", $text, "'".$_."' missing", 1);
print CLIENTCRAP $output;
}
@ -541,10 +628,10 @@ sub print_unknown {
sub check_autorun {
my ($script) = @_;
my (undef, $plname) = get_names($script);
my $n = get_names($script);
my $dir = Irssi::get_irssi_dir()."/scripts/";
if (-e $dir."/autorun/".$plname) {
if (readlink($dir."/autorun/".$plname) eq "../".$plname) {
if (-e $dir."/autorun/".$n->{plname}) {
if (readlink($dir."/autorun/".$n->{plname}) eq "../".$n->{plname}) {
return 1;
}
}
@ -582,14 +669,15 @@ sub print_info {
my $line;
foreach my $script (sort keys(%data)) {
my ($local, $autorun);
if (get_local_version($script)) {
my $n = get_names($script);
if ($n->{stash}) {
$line .= "%go%n ";
$local = get_local_version($script);
$local = $n->{local_version};
} else {
$line .= "%ro%n ";
$local = undef;
}
if (defined $local || check_autorun($script)) {
if ($n->{stash} || check_autorun($script)) {
$autorun = "no";
$autorun = "yes" if check_autorun($script);
} else {
@ -643,7 +731,7 @@ sub print_ratings {
my @table;
foreach my $script (sort {$data{$b}{rating}<=>$data{$a}{rating}} keys(%data)) {
my @line;
if (get_local_version($script)) {
if (get_names($script)->{stash}) {
push @line, "%go%n";
} else {
push @line, "%yo%n";
@ -660,13 +748,13 @@ sub print_new {
my @table;
foreach (sort {$list->{$b}{modified} cmp $list->{$a}{modified}} keys %$list) {
my @line;
my ($name) = get_names($_);
if (get_local_version($name)) {
my $n = get_names($_);
if ($n->{stash}) {
push @line, "%go%n";
} else {
push @line, "%yo%n";
}
push @line, "%9".$name."%9";
push @line, "%9".$n->{sname}."%9";
push @line, $list->{$_}{modified};
push @table, \@line;
}
@ -678,14 +766,23 @@ sub print_debug {
my $line;
foreach my $script (sort keys %data) {
$line .= "%ro%n %9".$script."%9 failed to load\n";
$line .= " Make sure you have the following perl modules installed:\n";
my $py = $data{$script}{'irssi-python module'};
if ($py) { # py
$line .= " You are attempting to load a Python script!\n";
} else {
$line .= " Make sure you have the following perl modules installed:\n";
}
foreach (sort keys %{$data{$script}}) {
if ( $data{$script}{$_}{installed} == 1 ) {
$line .= " %g->%n ".$_." (found)";
} else {
$line .= " %r->%n ".$_." (not found)\n";
$line .= " [This module is optional]\n" if $data{$script}{$_}{optional};
$line .= " [Try /scriptassist cpan ".$_."]";
if ($py) { # py
$line .= " [If you have it installed, try: /load python]";
} else {
$line .= " [Try /scriptassist cpan ".$_."]";
}
}
$line .= "\n";
}
@ -695,7 +792,13 @@ sub print_debug {
sub load_script {
my ($script) = @_;
Irssi::command('script load '.$script);
if ($script =~ s/\.py$//i) { # py
if (is_python_loaded()) {
Irssi::command('py load '.$script);
}
} else {
Irssi::command('script load '.$script); # pl
}
}
sub print_install {
@ -715,7 +818,7 @@ sub print_install {
} else {
load_script($script) unless (lc($script) eq lc($IRSSI{name}));
}
if (get_local_version($script) && not lc($script) eq lc($IRSSI{name})) {
if (get_names($script)->{stash} && not lc($script) eq lc($IRSSI{name})) {
$line .= "%go%n %9".$script."%9 installed\n";
push @installed, $script;
} elsif (lc($script) eq lc($IRSSI{name})) {
@ -751,16 +854,14 @@ sub list_sbitems {
my ($scripts) = @_;
my $text;
foreach (@$scripts) {
next unless exists $Irssi::Script::{"${_}::"};
next unless exists $Irssi::Script::{"${_}::"}{IRSSI};
my $header = $Irssi::Script::{"${_}::"}{IRSSI};
next unless $header->{sbitems};
my $n = get_names($_);
next unless $n->{irssi}{sbitems};
$text .= '%9"'.$_.'"%9 provides the following statusbar item(s):'."\n";
$text .= ' ->'.$_."\n" foreach (split / /, $header->{sbitems});
$text .= ' ->'.$_."\n" foreach (split / /, $n->{irssi}{sbitems});
}
return unless $text;
$text .= "\n";
$text .= "Enter '/statusbar window add <item>' to add an item.";
$text .= "Enter '/statusbar additem <item> window' to add an item.";
print CLIENTCRAP draw_box('ScriptAssist', $text, 'sbitems', 1);
}
@ -838,14 +939,12 @@ sub print_update {
sub contact_author {
my ($script) = @_;
my ($sname, $plname, $pname) = get_names($script);
return unless exists $Irssi::Script::{$pname};
my $header = $Irssi::Script::{$pname}{IRSSI};
if ($header && defined $header->{contact}) {
my @ads = split(/ |,/, $header->{contact});
my $n = get_names($script);
if ($n->{irssi} && defined $n->{irssi}{contact}) {
my @ads = split(/ |,/, $n->{irssi}{contact});
my $address = $ads[0];
$address .= '?subject='.$script;
$address .= '_'.get_local_version($script) if defined get_local_version($script);
$address .= '_'.$n->{local_version} if $n->{local_version};
call_openurl($address) if $address =~ /[\@:]/;
}
}
@ -874,6 +973,10 @@ sub get_scripts {
$error = join "\n", $response->status_line(), (grep / at .* line \d+/, split "\n", $response->content()), '';
next;
}
if (my $died = $response->header('X-Died')) {
$error = $died;
next;
}
$fetched = 1;
my $data = $response->content();
my $src = $site;
@ -929,20 +1032,6 @@ sub get_scripts {
return $remote_db{db};
}
sub get_remote_version {
my ($script, $database) = @_;
my $plname = (get_names($script, $database))[1];
return $database->{$plname}{version};
}
sub get_local_version {
my ($script) = @_;
my $pname = (get_names($script))[2];
return unless exists $Irssi::Script::{$pname};
my $vref = $Irssi::Script::{$pname}{VERSION};
return $vref ? $$vref : undef;
}
sub compare_versions {
my ($ver1, $ver2) = @_;
for ($ver1, $ver2) {
@ -959,11 +1048,42 @@ sub compare_versions {
return 'equal';
}
sub is_python_loaded {
!! grep { $_->{cmd} eq 'py' } Irssi::commands
}
my @print_text_capture;
sub capture_print_text {
my ($dest, $text, $plain) = @_;
push @print_text_capture, $plain;
Irssi::signal_stop;
}
sub capture_print_text_command {
my ($command, $sub) = @_;
Irssi::signal_add_first('print text', 'capture_print_text');
@print_text_capture = ();
Irssi::command($command);
my @capture = @print_text_capture;
Irssi::signal_remove('print text', 'capture_print_text');
@print_text_capture = ();
$sub->(@capture);
}
sub loaded_scripts {
my @modules;
foreach (sort grep(s/::$//, keys %Irssi::Script::)) {
foreach (sort grep(s/::$//, keys %Irssi::Script::)) { # pl
push @modules, $_;
}
if (is_python_loaded()) {
capture_print_text_command(
'py list', sub {
for my $line (@_[ 1 .. $#_ ]) {
my ($script, $file) = split ' ', $line, 2;
push @modules, "$script.py";
}
});
}
return \@modules;
}
@ -971,9 +1091,9 @@ sub check_scripts {
my ($data) = @_;
my %versions;
foreach (@{loaded_scripts()}) {
my ($sname) = get_names($_, $data);
my $remote = get_remote_version($sname, $data);
my $local = get_local_version($sname);
my $n = get_names($_, $data);
my $remote = $n->{db_version};
my $local = $n->{local_version};
my $state;
if ($local && $remote) {
$state = compare_versions($local, $remote);
@ -986,9 +1106,9 @@ sub check_scripts {
$remote = '/';
}
if ($state) {
$versions{$sname}{state} = $state;
$versions{$sname}{remote} = $remote;
$versions{$sname}{local} = $local;
$versions{$n->{sname}}{state} = $state;
$versions{$n->{sname}}{remote} = $remote;
$versions{$n->{sname}}{local} = $local;
}
}
return \%versions;
@ -996,40 +1116,40 @@ sub check_scripts {
sub download_script {
my ($script, $xml) = @_;
my ($sname, $plname) = get_names($script, $xml);
my $n = get_names($script, $xml);
my $site = $n->{db}{source};
my %result;
my $site = $xml->{$plname}{source};
$result{installed} = 0;
$result{signed} = 0;
my $dir = Irssi::get_irssi_dir();
my $ua = LWP::UserAgent->new(env_proxy => 1,keep_alive => 1,timeout => 30);
my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30);
$ua->agent('ScriptAssist/'.2003020803);
my $request = HTTP::Request->new('GET', $site.'/scripts/'.$script.'.pl');
my $request = HTTP::Request->new('GET', $site.'/scripts/'.$n->{plname});
my $response = $ua->request($request);
if ($response->is_success()) {
if ($response->is_success() && !$response->header('X-Died')) {
my $file = $response->content();
mkdir $dir.'/scripts/' unless (-e $dir.'/scripts/');
open(my $F, '>', $dir.'/scripts/'.$plname.'.new');
print $F $file;
close($F);
open(my $f, '>', $dir.'/scripts/'.$n->{plname}.'.new');
print $f $file;
close($f);
if ($have_gpg && Irssi::settings_get_bool('scriptassist_use_gpg')) {
my $ua2 = LWP::UserAgent->new(env_proxy => 1,keep_alive => 1,timeout => 30);
$ua->agent('ScriptAssist/'.2003020803);
my $request2 = HTTP::Request->new('GET', $site.'/signatures/'.$plname.'.asc');
my $request2 = HTTP::Request->new('GET', $site.'/signatures/'.$n->{plname}.'.asc');
my $response2 = $ua->request($request2);
if ($response2->is_success()) {
if ($response2->is_success() && !$response->header('X-Died')) {
my $sig_dir = $dir.'/scripts/signatures/';
mkdir $sig_dir unless (-e $sig_dir);
open(my $S, '>', $sig_dir.$plname.'.asc');
open(my $s, '>', $sig_dir.$n->{plname}.'.asc');
my $file2 = $response2->content();
print $S $file2;
close($S);
print $s $file2;
close($s);
my $sig;
foreach (1..2) {
# FIXME gpg needs two rounds to load the key
my $gpg = new GnuPG();
eval {
$sig = $gpg->verify( file => $dir.'/scripts/'.$plname.'.new', signature => $sig_dir.$plname.'.asc' );
$sig = $gpg->verify( file => $dir.'/scripts/'.$n->{plname}.'.new', signature => $sig_dir.$n->{plname}.'.asc' );
};
}
if (defined $sig->{user}) {
@ -1055,8 +1175,8 @@ sub download_script {
if ($result{installed}) {
my $old_dir = "$dir/scripts/old/";
mkdir $old_dir unless (-e $old_dir);
rename "$dir/scripts/$plname", "$old_dir/$plname.old" if -e "$dir/scripts/$plname";
rename "$dir/scripts/$plname.new", "$dir/scripts/$plname";
rename "$dir/scripts/".$n->{plname}, "$old_dir/".$n->{plname}.".old" if -e "$dir/scripts/".$n->{plname};
rename "$dir/scripts/".$n->{plname}.".new", "$dir/scripts/".$n->{plname};
}
return \%result;
}
@ -1083,23 +1203,23 @@ sub print_check {
sub toggle_autorun {
my ($script) = @_;
my ($sname, $plname) = get_names($script);
my $n = get_names($script);
my $dir = Irssi::get_irssi_dir()."/scripts/";
mkdir $dir."autorun/" unless (-e $dir."autorun/");
return unless (-e $dir.$plname);
if (-e $dir."/autorun/".$plname) {
if (readlink($dir."/autorun/".$plname) eq "../".$plname) {
if (unlink($dir."/autorun/".$plname)) {
print CLIENTCRAP "%R>>%n Autorun of ".$sname." disabled";
return unless (-e $dir.$n->{plname});
if (-e $dir."/autorun/".$n->{plname}) {
if (readlink($dir."/autorun/".$n->{plname}) eq "../".$n->{plname}) {
if (unlink($dir."/autorun/".$n->{plname})) {
print CLIENTCRAP "%R>>%n Autorun of ".$n->{sname}." disabled";
} else {
print CLIENTCRAP "%R>>%n Unable to delete link";
}
} else {
print CLIENTCRAP "%R>>%n ".$dir."/autorun/".$plname." is not a correct link";
print CLIENTCRAP "%R>>%n ".$dir."/autorun/".$n->{plname}." is not a correct link";
}
} else {
if (symlink("../".$plname, $dir."/autorun/".$plname)) {
print CLIENTCRAP "%R>>%n Autorun of ".$sname." enabled";
if (symlink("../".$n->{plname}, $dir."/autorun/".$n->{plname})) {
print CLIENTCRAP "%R>>%n Autorun of ".$n->{sname}." enabled";
} else {
print CLIENTCRAP "%R>>%n Unable to create autorun link";
}
@ -1178,9 +1298,9 @@ sub cmd_help {
sub sig_command_script_load {
my ($script, $server, $witem) = @_;
my ($sname, $plname, $pname, $xname) = get_names($script);
if ( exists $Irssi::Script::{$pname} ) {
if (my $code = "Irssi::Script::${pname}"->can('pre_unload')) {
my $n = get_names($script);
if ( $n->{stash} ) {
if (my $code = ("Irssi::Script::".$n->{pname})->can('pre_unload')) {
print CLIENTCRAP "%R>>%n Triggering pre_unload function of $script...";
$code->();
}

View file

@ -1,27 +0,0 @@
if BUILD_TEXTUI
TEXTUI=fe-text
endif
if BUILD_IRSSIBOT
BOTUI=fe-none
endif
if BUILD_IRSSIFUZZER
FUZZERUI=fe-fuzz
endif
if HAVE_PERL
PERLDIR=perl
endif
if HAVE_OTR
OTRDIR=otr
endif
pkginc_srcdir=$(pkgincludedir)/src
pkginc_src_HEADERS = \
common.h
SUBDIRS = lib-config core irc fe-common $(PERLDIR) $(OTRDIR) $(TEXTUI) $(BOTUI) $(FUZZERUI)
EXTRA_DIST = meson.build

View file

@ -6,7 +6,7 @@
#define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */
#define IRSSI_ABI_VERSION 46
#define IRSSI_ABI_VERSION 58
#define DEFAULT_SERVER_ADD_PORT 6667
#define DEFAULT_SERVER_ADD_TLS_PORT 6697
@ -37,9 +37,8 @@
#include <fcntl.h>
#include <glib.h>
#ifdef HAVE_GMODULE
# include <gmodule.h>
#endif
#include <gmodule.h>
#include <gio/gio.h>
typedef guint64 uoff_t;
#define PRIuUOFF_T G_GUINT64_FORMAT

View file

@ -1,122 +0,0 @@
noinst_LIBRARIES = libcore.a
AM_CPPFLAGS = \
-I$(top_builddir) \
$(GLIB_CFLAGS) \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DMODULEDIR=\""$(libdir)/irssi/modules"\"
if USE_GREGEX
regex_impl=iregex-gregex.c
else
regex_impl=iregex-regexh.c
endif
libcore_a_SOURCES = \
args.c \
channels.c \
channels-setup.c \
commands.c \
chat-commands.c \
chat-protocols.c \
chatnets.c \
core.c \
expandos.c \
ignore.c \
levels.c \
line-split.c \
log.c \
log-away.c \
masks.c \
misc.c \
modules.c \
modules-load.c \
net-disconnect.c \
net-nonblock.c \
net-sendbuffer.c \
network.c \
network-openssl.c \
nicklist.c \
nickmatch-cache.c \
pidwait.c \
queries.c \
rawlog.c \
recode.c \
refstrings.c \
servers.c \
servers-reconnect.c \
servers-setup.c \
session.c \
settings.c \
signals.c \
special-vars.c \
utf8.c \
$(regex_impl) \
wcwidth.c \
wcwidth-wrapper.c \
tls.c \
write-buffer.c
if HAVE_CAPSICUM
libcore_a_SOURCES += \
capsicum.c
endif
structure_headers = \
channel-rec.h \
channel-setup-rec.h \
chatnet-rec.h \
query-rec.h \
server-rec.h \
server-setup-rec.h \
server-connect-rec.h \
window-item-rec.h
pkginc_coredir=$(pkgincludedir)/src/core
pkginc_core_HEADERS = \
args.h \
capsicum.h \
channels.h \
channels-setup.h \
commands.h \
chat-protocols.h \
chatnets.h \
core.h \
expandos.h \
ignore.h \
levels.h \
line-split.h \
log.h \
masks.h \
misc.h \
module.h \
modules.h \
modules-load.h \
net-disconnect.h \
net-nonblock.h \
net-sendbuffer.h \
network.h \
network-openssl.h \
nick-rec.h \
nicklist.h \
nickmatch-cache.h \
pidwait.h \
queries.h \
rawlog.h \
recode.h \
refstrings.h \
servers.h \
servers-reconnect.h \
servers-setup.h \
session.h \
settings.h \
signals.h \
special-vars.h \
utf8.h \
iregex.h \
window-item-def.h \
tls.h \
write-buffer.h \
$(structure_headers)
EXTRA_DIST = meson.build

View file

@ -227,8 +227,7 @@ void channels_setup_init(void)
setupchannels = NULL;
source_host_ok = FALSE;
signal_add("setup reread", (SIGNAL_FUNC) channels_read_config);
signal_add("irssi init read settings", (SIGNAL_FUNC) channels_read_config);
signal_add("setup reread channels", (SIGNAL_FUNC) channels_read_config);
}
void channels_setup_deinit(void)
@ -236,6 +235,5 @@ void channels_setup_deinit(void)
while (setupchannels != NULL)
channel_setup_destroy(setupchannels->data);
signal_remove("setup reread", (SIGNAL_FUNC) channels_read_config);
signal_remove("irssi init read settings", (SIGNAL_FUNC) channels_read_config);
signal_remove("setup reread channels", (SIGNAL_FUNC) channels_read_config);
}

View file

@ -30,6 +30,7 @@
#include <irssi/src/core/servers-setup.h>
#include <irssi/src/core/servers-reconnect.h>
#include <irssi/src/core/channels.h>
#include <irssi/src/core/chatnets.h>
#include <irssi/src/core/queries.h>
#include <irssi/src/core/window-item-def.h>
#include <irssi/src/core/rawlog.h>
@ -91,7 +92,7 @@ static SERVER_CONNECT_REC *get_server_connect(const char *data, int *plus_addr,
return NULL;
}
if (strchr(addr, '/') != NULL)
if (strchr(addr, '/') != NULL && chatnet_find(addr) == NULL)
conn->unix_socket = TRUE;
/* TLS options are handled in server_create_conn_opt ... -> server_setup_fill_optlist */
@ -100,10 +101,11 @@ static SERVER_CONNECT_REC *get_server_connect(const char *data, int *plus_addr,
host = g_hash_table_lookup(optlist, "host");
if (host != NULL && *host != '\0') {
IPADDR ip4, ip6;
if (net_gethostbyname(host, &ip4, &ip6) == 0)
server_connect_own_ip_save(conn, &ip4, &ip6);
IPADDR ip4 = { 0 };
IPADDR ip6 = { 0 };
if (net_gethostbyname_first_ips(host, G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT, &ip4,
&ip6) == 0)
server_connect_own_ip_save(conn, &ip4, &ip6);
}
cmd_params_free(free_arg);

View file

@ -47,7 +47,7 @@ int chat_protocol_lookup(const char *name)
g_return_val_if_fail(name != NULL, -1);
rec = chat_protocol_find(name);
return rec == NULL ? -1 : rec->id;
return rec == NULL ? -1 : rec->not_initialized ? CHAT_PROTOCOL_NOT_INITIALIZED : rec->id;
}
CHAT_PROTOCOL_REC *chat_protocol_find(const char *name)
@ -99,6 +99,22 @@ CHAT_PROTOCOL_REC *chat_protocol_find_net(GHashTable *optlist)
return NULL;
}
static void chat_protocol_destroy(CHAT_PROTOCOL_REC *rec)
{
g_return_if_fail(rec != NULL);
chat_protocols = g_slist_remove(chat_protocols, rec);
if (default_proto == rec) {
chat_protocol_set_default(chat_protocols == NULL ? NULL : chat_protocols->data);
}
signal_emit("chat protocol destroyed", 1, rec);
g_free(rec->name);
g_free(rec);
}
/* Register new chat protocol. */
CHAT_PROTOCOL_REC *chat_protocol_register(CHAT_PROTOCOL_REC *rec)
{
@ -108,7 +124,11 @@ CHAT_PROTOCOL_REC *chat_protocol_register(CHAT_PROTOCOL_REC *rec)
g_return_val_if_fail(rec != NULL, NULL);
newrec = chat_protocol_find(rec->name);
created = newrec == NULL;
if (newrec != NULL && newrec->not_initialized) {
chat_protocol_destroy(newrec);
newrec = NULL;
}
created = newrec == NULL;
if (newrec == NULL) {
newrec = g_new0(CHAT_PROTOCOL_REC, 1);
chat_protocols = g_slist_append(chat_protocols, newrec);
@ -131,23 +151,6 @@ CHAT_PROTOCOL_REC *chat_protocol_register(CHAT_PROTOCOL_REC *rec)
return newrec;
}
static void chat_protocol_destroy(CHAT_PROTOCOL_REC *rec)
{
g_return_if_fail(rec != NULL);
chat_protocols = g_slist_remove(chat_protocols, rec);
if (default_proto == rec) {
chat_protocol_set_default(chat_protocols == NULL ? NULL :
chat_protocols->data);
}
signal_emit("chat protocol destroyed", 1, rec);
g_free(rec->name);
g_free(rec);
}
/* Unregister chat protocol. */
void chat_protocol_unregister(const char *name)
{
@ -191,15 +194,6 @@ static CHANNEL_SETUP_REC *create_channel_setup(void)
return g_new0(CHANNEL_SETUP_REC, 1);
}
static SERVER_CONNECT_REC *create_server_connect(void)
{
return g_new0(SERVER_CONNECT_REC, 1);
}
static void destroy_server_connect(SERVER_CONNECT_REC *conn)
{
}
/* Return "unknown chat protocol" record. Used when protocol name is
specified but it isn't registered yet. */
CHAT_PROTOCOL_REC *chat_protocol_get_unknown(const char *name)
@ -218,8 +212,10 @@ CHAT_PROTOCOL_REC *chat_protocol_get_unknown(const char *name)
rec->create_chatnet = create_chatnet;
rec->create_server_setup = create_server_setup;
rec->create_channel_setup = create_channel_setup;
/*
rec->create_server_connect = create_server_connect;
rec->destroy_server_connect = destroy_server_connect;
*/
newrec = chat_protocol_register(rec);
g_free(rec);

View file

@ -35,6 +35,8 @@ void *chat_protocol_check_cast(void *object, int type_pos, const char *id);
((object) == NULL ? chat_protocol_get_default() : \
chat_protocol_find_id((object)->chat_type))
#define CHAT_PROTOCOL_NOT_INITIALIZED -2
/* Register new chat protocol. */
CHAT_PROTOCOL_REC *chat_protocol_register(CHAT_PROTOCOL_REC *rec);

View file

@ -24,12 +24,13 @@
#include <irssi/src/core/special-vars.h>
#include <irssi/src/lib-config/iconfig.h>
#include <irssi/src/core/settings.h>
#include <irssi/src/core/misc.h>
#include <irssi/src/core/chat-protocols.h>
#include <irssi/src/core/chatnets.h>
#include <irssi/src/core/servers.h>
GSList *chatnets; /* list of available chat networks */
GSList *chatnets, *chatnets_unavailable; /* list of available chat networks */
static void chatnet_config_save(CHATNET_REC *chatnet)
{
@ -60,8 +61,9 @@ static void chatnet_config_remove(CHATNET_REC *chatnet)
void chatnet_create(CHATNET_REC *chatnet)
{
g_return_if_fail(chatnet != NULL);
g_return_if_fail(!CHAT_PROTOCOL(chatnet)->not_initialized);
chatnet->type = module_get_uniq_id("CHATNET", 0);
chatnet->type = module_get_uniq_id("CHATNET", 0);
if (g_slist_find(chatnets, chatnet) == NULL)
chatnets = g_slist_append(chatnets, chatnet);
@ -112,6 +114,21 @@ CHATNET_REC *chatnet_find(const char *name)
return NULL;
}
gboolean chatnet_find_unavailable(const char *name)
{
CHAT_PROTOCOL_REC *proto;
if (i_slist_find_icase_string(chatnets_unavailable, name) != NULL)
return TRUE;
proto = CHAT_PROTOCOL(chatnet_find(name));
if (proto == NULL || proto->not_initialized)
return TRUE;
return FALSE;
}
static void sig_connected(SERVER_REC *server)
{
CHATNET_REC *rec;
@ -136,14 +153,22 @@ static void chatnet_read(CONFIG_NODE *node)
return;
type = config_node_get_str(node, "type", NULL);
proto = type == NULL ? NULL : chat_protocol_find(type);
if (proto == NULL) {
proto = type == NULL ? chat_protocol_get_default() :
chat_protocol_get_unknown(type);
if (type == NULL) {
proto = chat_protocol_get_default();
} else {
proto = chat_protocol_find(type);
}
if (type == NULL)
if (proto == NULL) {
/* protocol not loaded */
if (i_slist_find_icase_string(chatnets_unavailable, node->key) == NULL)
chatnets_unavailable =
g_slist_append(chatnets_unavailable, g_strdup(node->key));
return;
} else if (type == NULL) {
iconfig_node_set_str(node, "type", proto->name);
}
rec = proto->create_chatnet();
rec->type = module_get_uniq_id("CHATNET", 0);
@ -167,6 +192,12 @@ static void read_chatnets(void)
while (chatnets != NULL)
chatnet_destroy(chatnets->data);
while (chatnets_unavailable != NULL) {
char *name = chatnets_unavailable->data;
chatnets_unavailable = g_slist_remove(chatnets_unavailable, name);
g_free(name);
}
node = iconfig_node_traverse("chatnets", FALSE);
if (node != NULL) {
tmp = config_node_first(node->value);
@ -180,8 +211,7 @@ void chatnets_init(void)
chatnets = NULL;
signal_add_first("event connected", (SIGNAL_FUNC) sig_connected);
signal_add("setup reread", (SIGNAL_FUNC) read_chatnets);
signal_add_first("irssi init read settings", (SIGNAL_FUNC) read_chatnets);
signal_add("setup reread chatnets", (SIGNAL_FUNC) read_chatnets);
}
void chatnets_deinit(void)
@ -189,6 +219,5 @@ void chatnets_deinit(void)
module_uniq_destroy("CHATNET");
signal_remove("event connected", (SIGNAL_FUNC) sig_connected);
signal_remove("setup reread", (SIGNAL_FUNC) read_chatnets);
signal_remove("irssi init read settings", (SIGNAL_FUNC) read_chatnets);
signal_remove("setup reread chatnets", (SIGNAL_FUNC) read_chatnets);
}

View file

@ -25,6 +25,8 @@ void chatnet_destroy(CHATNET_REC *chatnet);
/* Find the chat network by name */
CHATNET_REC *chatnet_find(const char *name);
/* Check if this chatnet is unavailable because the protocol is not loaded */
gboolean chatnet_find_unavailable(const char *name);
void chatnets_init(void);
void chatnets_deinit(void);

View file

@ -68,6 +68,7 @@ void wcwidth_wrapper_deinit(void);
int irssi_gui;
int irssi_init_finished;
int sighup_received;
int sigterm_received;
time_t client_start_time;
static char *irssi_dir, *irssi_config_file;
@ -89,6 +90,11 @@ static void sig_hup(int signo)
sighup_received = TRUE;
}
static void sig_term(int signo)
{
sigterm_received = TRUE;
}
static void read_settings(void)
{
static int signals[] = {
@ -113,8 +119,15 @@ static void read_settings(void)
sigaction(SIGHUP, &act, NULL);
for (n = 0; n < sizeof(signals)/sizeof(signals[0]); n++) {
act.sa_handler = find_substr(ignores, signames[n]) ?
SIG_IGN : SIG_DFL;
if (find_substr(ignores, signames[n])) {
act.sa_handler = SIG_IGN;
} else {
/* set default handlers */
if (signals[n] == SIGTERM)
act.sa_handler = sig_term;
else
act.sa_handler = SIG_DFL;
}
sigaction(signals[n], &act, NULL);
}
@ -223,6 +236,13 @@ static void sig_irssi_init_finished(void)
irssi_init_finished = TRUE;
}
static void reread_setup(void)
{
signal_emit("setup reread chatnets", 0);
signal_emit("setup reread servers", 0);
signal_emit("setup reread channels", 0);
}
void core_init(void)
{
dialog_type_queue = NULL;
@ -269,13 +289,16 @@ void core_init(void)
settings_add_str("misc", "ignore_signals", "");
settings_add_bool("misc", "override_coredump_limit", FALSE);
settings_add_bool("misc", "quit_on_hup", FALSE);
settings_add_str("misc", "autoload_modules", "perl otr");
settings_add_str("misc", "autoload_modules", "irc dcc flood notifylist perl otr");
#ifdef HAVE_SYS_RESOURCE_H
getrlimit(RLIMIT_CORE, &orig_core_rlimit);
#endif
read_settings();
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
signal_add("setup reread", (SIGNAL_FUNC) reread_setup);
signal_add("irssi init read settings", (SIGNAL_FUNC) reread_setup);
signal_add_last("chat protocol created", (SIGNAL_FUNC) reread_setup);
signal_add("irssi init finished", (SIGNAL_FUNC) sig_irssi_init_finished);
settings_check();
@ -288,6 +311,9 @@ void core_deinit(void)
module_uniq_destroy("WINDOW ITEM TYPE");
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
signal_remove("setup reread", (SIGNAL_FUNC) reread_setup);
signal_remove("irssi init read settings", (SIGNAL_FUNC) reread_setup);
signal_remove("chat protocol created", (SIGNAL_FUNC) reread_setup);
signal_remove("irssi init finished", (SIGNAL_FUNC) sig_irssi_init_finished);
wcwidth_wrapper_deinit();

View file

@ -14,6 +14,7 @@
extern int irssi_gui;
extern int irssi_init_finished; /* TRUE after "irssi init finished" signal is sent */
extern int sighup_received; /* TRUE after received SIGHUP. */
extern int sigterm_received; /* TRUE after received SIGTERM. */
extern time_t client_start_time;
void core_preinit(const char *path);

View file

@ -1,99 +0,0 @@
#include <irssi/src/core/iregex.h>
Regex *
i_regex_new (const gchar *pattern,
GRegexCompileFlags compile_options,
GRegexMatchFlags match_options,
GError **error)
{
Regex *regex;
char *errbuf;
int cflags;
int errcode, errbuf_len;
regex = g_new0(Regex, 1);
cflags = REG_EXTENDED;
if (compile_options & G_REGEX_CASELESS)
cflags |= REG_ICASE;
if (compile_options & G_REGEX_MULTILINE)
cflags |= REG_NEWLINE;
if (match_options & G_REGEX_MATCH_NOTBOL)
cflags |= REG_NOTBOL;
if (match_options & G_REGEX_MATCH_NOTEOL)
cflags |= REG_NOTEOL;
errcode = regcomp(regex, pattern, cflags);
if (errcode != 0) {
errbuf_len = regerror(errcode, regex, 0, 0);
errbuf = g_malloc(errbuf_len);
regerror(errcode, regex, errbuf, errbuf_len);
g_set_error(error, G_REGEX_ERROR, errcode, "%s", errbuf);
g_free(errbuf);
g_free(regex);
return NULL;
} else {
return regex;
}
}
void
i_regex_unref (Regex *regex)
{
regfree(regex);
g_free(regex);
}
gboolean
i_regex_match (const Regex *regex,
const gchar *string,
GRegexMatchFlags match_options,
MatchInfo **match_info)
{
int groups;
int eflags;
g_return_val_if_fail(regex != NULL, FALSE);
if (match_info != NULL) {
groups = 1 + regex->re_nsub;
*match_info = g_new0(MatchInfo, groups);
} else {
groups = 0;
}
eflags = 0;
if (match_options & G_REGEX_MATCH_NOTBOL)
eflags |= REG_NOTBOL;
if (match_options & G_REGEX_MATCH_NOTEOL)
eflags |= REG_NOTEOL;
return regexec(regex, string, groups, groups ? *match_info : NULL, eflags) == 0;
}
gboolean
i_match_info_fetch_pos (const MatchInfo *match_info,
gint match_num,
gint *start_pos,
gint *end_pos)
{
if (start_pos != NULL)
*start_pos = match_info[match_num].rm_so;
if (end_pos != NULL)
*end_pos = match_info[match_num].rm_eo;
return TRUE;
}
gboolean
i_match_info_matches (const MatchInfo *match_info)
{
g_return_val_if_fail(match_info != NULL, FALSE);
return match_info[0].rm_so != -1;
}
void
i_match_info_free (MatchInfo *match_info)
{
g_free(match_info);
}

View file

@ -3,20 +3,10 @@
#include <irssi/src/common.h>
#ifdef USE_GREGEX
#include <glib.h>
typedef GRegex Regex;
typedef struct _MatchInfo MatchInfo;
#else
#include <regex.h>
typedef regex_t Regex;
typedef regmatch_t MatchInfo;
#endif
gboolean
i_match_info_matches (const MatchInfo *match_info);

View file

@ -19,14 +19,17 @@
*/
#include "module.h"
#include <irssi/src/core/misc.h>
#include <irssi/src/core/levels.h>
/* the order of these levels must match the bits in levels.h */
static const char *levels[] = {
/* clang-format off */
"CRAP",
"MSGS",
"PUBLICS",
"NOTICES",
"PUBNOTICES",
"SNOTES",
"CTCPS",
"ACTIONS",
@ -46,6 +49,7 @@ static const char *levels[] = {
"CLIENTERRORS",
"HILIGHTS",
NULL
/* clang-format on */
};
int level_get(const char *level)
@ -166,8 +170,7 @@ char *bits2level(int bits)
if (str->len > 0)
g_string_truncate(str, str->len-1);
ret = str->str;
g_string_free(str, FALSE);
ret = g_string_free_and_steal(str);
return ret;
}

View file

@ -13,26 +13,27 @@ enum {
MSGLEVEL_MSGS = 0x0000002,
MSGLEVEL_PUBLIC = 0x0000004,
MSGLEVEL_NOTICES = 0x0000008,
MSGLEVEL_SNOTES = 0x0000010,
MSGLEVEL_CTCPS = 0x0000020,
MSGLEVEL_ACTIONS = 0x0000040,
MSGLEVEL_JOINS = 0x0000080,
MSGLEVEL_PARTS = 0x0000100,
MSGLEVEL_QUITS = 0x0000200,
MSGLEVEL_KICKS = 0x0000400,
MSGLEVEL_MODES = 0x0000800,
MSGLEVEL_TOPICS = 0x0001000,
MSGLEVEL_WALLOPS = 0x0002000,
MSGLEVEL_INVITES = 0x0004000,
MSGLEVEL_NICKS = 0x0008000,
MSGLEVEL_DCC = 0x0010000,
MSGLEVEL_DCCMSGS = 0x0020000,
MSGLEVEL_CLIENTNOTICE = 0x0040000,
MSGLEVEL_CLIENTCRAP = 0x0080000,
MSGLEVEL_CLIENTERROR = 0x0100000,
MSGLEVEL_HILIGHT = 0x0200000,
MSGLEVEL_PUBNOTICES = 0x0000010,
MSGLEVEL_SNOTES = 0x0000020,
MSGLEVEL_CTCPS = 0x0000040,
MSGLEVEL_ACTIONS = 0x0000080,
MSGLEVEL_JOINS = 0x0000100,
MSGLEVEL_PARTS = 0x0000200,
MSGLEVEL_QUITS = 0x0000400,
MSGLEVEL_KICKS = 0x0000800,
MSGLEVEL_MODES = 0x0001000,
MSGLEVEL_TOPICS = 0x0002000,
MSGLEVEL_WALLOPS = 0x0004000,
MSGLEVEL_INVITES = 0x0008000,
MSGLEVEL_NICKS = 0x0010000,
MSGLEVEL_DCC = 0x0020000,
MSGLEVEL_DCCMSGS = 0x0040000,
MSGLEVEL_CLIENTNOTICE = 0x0080000,
MSGLEVEL_CLIENTCRAP = 0x0100000,
MSGLEVEL_CLIENTERROR = 0x0200000,
MSGLEVEL_HILIGHT = 0x0400000,
MSGLEVEL_ALL = 0x03fffff,
MSGLEVEL_ALL = 0x07fffff,
MSGLEVEL_NOHILIGHT = 0x1000000, /* Don't highlight this message */
MSGLEVEL_NO_ACT = 0x2000000, /* Don't trigger channel activity */

View file

@ -1,18 +1,13 @@
# this file is part of irssi
if want_gregex
regex_impl = files('iregex-gregex.c')
else
regex_impl = files('iregex-regexh.c')
endif
if have_capsicum
core_capsicum_source = files('capsicum.c')
else
core_capsicum_source = []
core_capsicum_source = [ ]
endif
libcore_a = static_library('core',
libcore_a = static_library(
'core',
files(
'args.c',
'channels-setup.c',
@ -24,6 +19,7 @@ libcore_a = static_library('core',
'core.c',
'expandos.c',
'ignore.c',
'iregex-gregex.c',
'levels.c',
'line-split.c',
'log-away.c',
@ -58,7 +54,6 @@ libcore_a = static_library('core',
'write-buffer.c',
)
+ core_capsicum_source
+ regex_impl
+ [
default_config_h,
irssi_version_h,
@ -69,7 +64,8 @@ libcore_a = static_library('core',
def_moduledir,
def_sysconfdir,
],
dependencies : dep)
dependencies : dep,
)
install_headers(
files(
@ -128,4 +124,5 @@ install_headers(
'window-item-def.h',
'write-buffer.h',
),
subdir : incdir / 'src' / 'core')
subdir : incdir / 'src' / 'core',
)

View file

@ -135,6 +135,15 @@ GDateTime *g_date_time_new_from_iso8601(const gchar *iso_date, GTimeZone *defaul
}
#endif
#if GLIB_CHECK_VERSION(2, 76, 0)
/* nothing */
#else
gchar *g_string_free_and_steal(GString *string)
{
return g_string_free(string, FALSE);
}
#endif
int find_substr(const char *list, const char *item)
{
const char *ptr;
@ -261,8 +270,7 @@ char *gslistptr_to_string(GSList *list, int offset, const char *delimiter)
list = list->next;
}
ret = str->str;
g_string_free(str, FALSE);
ret = g_string_free_and_steal(str);
return ret;
}
@ -280,8 +288,7 @@ char *i_slist_to_string(GSList *list, const char *delimiter)
list = list->next;
}
ret = str->str;
g_string_free(str, FALSE);
ret = g_string_free_and_steal(str);
return ret;
}

View file

@ -26,6 +26,12 @@ long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2) G_GNUC_DEPRECATE
GDateTime *g_date_time_new_from_iso8601(const gchar *iso_date, GTimeZone *default_tz);
#endif
#if GLIB_CHECK_VERSION(2, 76, 0)
/* nothing */
#else
gchar *g_string_free_and_steal(GString *string);
#endif
GSList *i_slist_find_string(GSList *list, const char *key);
GSList *i_slist_find_icase_string(GSList *list, const char *key);
GList *i_list_find_string(GList *list, const char *key);

View file

@ -27,8 +27,6 @@
#include <irssi/src/core/commands.h>
#include <irssi/src/core/misc.h>
#ifdef HAVE_GMODULE
/* Returns the module name without path, "lib" prefix or ".so" suffix */
static char *module_get_name(const char *path, int *start, int *end)
{
@ -44,7 +42,7 @@ static char *module_get_name(const char *path, int *start, int *end)
if (name == NULL)
name = path;
if (strncmp(name, "lib", 3) == 0)
if (strncmp(name, "lib", 3) == 0 || strncmp(name, "cyg", 3) == 0)
name += 3;
module_name = g_strdup(name);
@ -104,10 +102,41 @@ static char *module_get_sub(const char *name, const char *root)
return g_strdup(name);
}
static GModule *module_open(const char *name, int *found)
static GModule *module_open(const char *name)
{
struct stat statbuf;
GModule *module;
#if GLIB_CHECK_VERSION(2, 75, 0)
/* in this version of glib, g_module_open knows how to construct system-dependent module
file names, and g_module_build_path is deprecated. */
char *path;
if (g_path_is_absolute(name) || *name == '~' ||
(*name == '.' && name[1] == G_DIR_SEPARATOR))
path = g_strdup(name);
else {
/* first try from home dir */
path = g_strdup_printf("%s/modules/%s", get_irssi_dir(), name);
module = g_module_open(path, (GModuleFlags) 0);
g_free(path);
if (module != NULL) {
return module;
}
/* module not found from home dir, try global module dir */
path = g_strdup_printf("%s/%s", MODULEDIR, name);
}
module = g_module_open(path, (GModuleFlags) 0);
g_free(path);
return module;
#else /* GLib < 2.75.0 */
/* in this version of glib, we build the module path with g_module_build_path.
unfortunately, this is broken on Darwin when compiled with meson. */
struct stat statbuf;
char *path, *str;
if (g_path_is_absolute(name) || *name == '~' ||
@ -122,7 +151,6 @@ static GModule *module_open(const char *name, int *found)
if (stat(path, &statbuf) == 0) {
module = g_module_open(path, (GModuleFlags) 0);
g_free(path);
*found = TRUE;
return module;
}
@ -131,10 +159,11 @@ static GModule *module_open(const char *name, int *found)
path = g_module_build_path(MODULEDIR, name);
}
*found = stat(path, &statbuf) == 0;
module = g_module_open(path, (GModuleFlags) 0);
g_free(path);
return module;
#endif
}
static char *module_get_func(const char *rootmodule, const char *submodule,
@ -153,8 +182,7 @@ static char *module_get_func(const char *rootmodule, const char *submodule,
signal_emit("module error", 4, GINT_TO_POINTER(error), text, \
rootmodule, submodule)
/* Returns 1 if ok, 0 if error in module and
-1 if module wasn't found */
/* Returns 1 if ok, 0 if not */
static int module_load_name(const char *path, const char *rootmodule,
const char *submodule, int silent)
{
@ -168,15 +196,15 @@ static int module_load_name(const char *path, const char *rootmodule,
gpointer value1, value2 = NULL;
char *versionfunc, *initfunc, *deinitfunc;
int module_abi_version = 0;
int found;
int valid;
gmodule = module_open(path, &found);
gmodule = module_open(path);
if (gmodule == NULL) {
if (!silent || found) {
if (!silent) {
module_error(MODULE_ERROR_LOAD, g_module_error(),
rootmodule, submodule);
}
return found ? 0 : -1;
return 0;
}
/* get the module's irssi abi version and bail out on mismatch */
@ -203,12 +231,12 @@ static int module_load_name(const char *path, const char *rootmodule,
/* get the module's init() and deinit() functions */
initfunc = module_get_func(rootmodule, submodule, "init");
deinitfunc = module_get_func(rootmodule, submodule, "deinit");
found = g_module_symbol(gmodule, initfunc, &value1) &&
g_module_symbol(gmodule, deinitfunc, &value2);
valid = g_module_symbol(gmodule, initfunc, &value1) &&
g_module_symbol(gmodule, deinitfunc, &value2);
g_free(initfunc);
g_free(deinitfunc);
if (!found) {
if (!valid) {
module_error(MODULE_ERROR_INVALID, NULL,
rootmodule, submodule);
g_module_close(gmodule);
@ -312,7 +340,7 @@ static int module_load_full(const char *path, const char *rootmodule,
/* check if the given module exists.. */
try_prefixes = g_strcmp0(rootmodule, submodule) == 0;
status = module_load_name(path, rootmodule, submodule, try_prefixes);
if (status == -1 && try_prefixes) {
if (status <= 0 && try_prefixes) {
/* nope, try loading the module_core,
fe_module, etc. */
status = module_load_prefixes(path, rootmodule,
@ -395,15 +423,6 @@ static void module_file_deinit_gmodule(MODULE_FILE_REC *file)
g_module_close(file->gmodule);
}
#else /* !HAVE_GMODULE - modules are not supported */
int module_load(const char *path, char **prefixes)
{
return FALSE;
}
#endif
void module_file_unload(MODULE_FILE_REC *file)
{
MODULE_REC *root;
@ -414,10 +433,8 @@ void module_file_unload(MODULE_FILE_REC *file)
if (file->initialized)
signal_emit("module unloaded", 2, file->root, file);
#ifdef HAVE_GMODULE
if (file->gmodule != NULL)
module_file_deinit_gmodule(file);
#endif
g_free(file->name);
g_free(file->defined_module_name);

View file

@ -16,13 +16,7 @@
#define MODULE_DATA(rec) \
g_hash_table_lookup((rec)->module_data, MODULE_NAME)
#ifdef HAVE_GMODULE
# define MODULE_IS_STATIC(rec) \
((rec)->gmodule == NULL)
#else
# define MODULE_IS_STATIC(rec) TRUE
#endif
#define MODULE_IS_STATIC(rec) ((rec)->gmodule == NULL)
#define MODULE_ABICHECK(fn_modulename) \
void fn_modulename ## _abicheck(int *version) \
@ -45,9 +39,7 @@ typedef struct {
char *defined_module_name;
void (*module_deinit) (void);
#ifdef HAVE_GMODULE
GModule *gmodule; /* static, if NULL */
#endif
unsigned int initialized:1;
} MODULE_FILE_REC;

View file

@ -21,6 +21,8 @@
#include "module.h"
#include <irssi/src/core/network.h>
#include <sys/select.h>
/* when quitting, wait for max. 5 seconds before forcing to close the socket */
#define MAX_QUIT_CLOSE_WAIT 5

View file

@ -22,86 +22,94 @@
#include <signal.h>
#include <irssi/src/core/pidwait.h>
#include <irssi/src/core/network.h>
#include <irssi/src/core/net-nonblock.h>
/* nonblocking gethostbyname(), ip (IPADDR) + error (int, 0 = not error) is
written to pipe when found PID of the resolver child is returned */
int net_gethostbyname_nonblock(const char *addr, GIOChannel *pipe, int reverse_lookup)
{
RESOLVED_IP_REC rec;
const char *errorstr;
int pid;
typedef struct {
GResolverNameLookupFlags flags;
NetGethostbynameContinuationFunc cont;
void *cont_data;
} NET_GETHOSTBYNAME_CALLBACK_DATA;
(void) reverse_lookup; /* Kept for API backward compatibility */
static void net_gethostbyname_callback(GResolver *resolver, GAsyncResult *result,
NET_GETHOSTBYNAME_CALLBACK_DATA *data)
{
/* GList<GInetAddress> */
GList *ailist;
GError *error;
RESOLVED_IP_REC *iprec;
error = NULL;
#if GLIB_CHECK_VERSION(2, 59, 0)
ailist = g_resolver_lookup_by_name_with_flags_finish(resolver, result, &error);
#else
/* compatibility code for old GLib */
ailist = g_resolver_lookup_by_name_finish(resolver, result, &error);
if (error == NULL && data->flags) {
GList *ll, *lll;
for (ll = ailist; ll != NULL; ll = lll) {
GInetAddress *address;
GSocketFamily family;
address = G_INET_ADDRESS(ll->data);
family = g_inet_address_get_family(address);
lll = ll->next;
if ((data->flags == G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY &&
family == G_SOCKET_FAMILY_IPV6) ||
(data->flags == G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY &&
family == G_SOCKET_FAMILY_IPV4)) {
g_object_unref(address);
ailist = g_list_delete_link(ailist, ll);
}
}
if (ailist == NULL) {
g_set_error(&error, G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND,
data->flags == G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY ?
"IPv4 address not found for host" :
"IPv6 address not found for host");
}
}
#endif
iprec = g_new0(RESOLVED_IP_REC, 1);
if (error != NULL) {
iprec->error = error;
} else {
iprec->ailist = ailist;
}
g_object_unref(resolver);
resolved_ip_ref(iprec);
data->cont(iprec, data->cont_data);
g_free(data);
}
/* nonblocking gethostbyname() */
GCancellable *net_gethostbyname_nonblock(const char *addr, GResolverNameLookupFlags flags,
NetGethostbynameContinuationFunc cont, void *cont_data)
{
GResolver *resolver;
GCancellable *cancellable;
NET_GETHOSTBYNAME_CALLBACK_DATA *data;
g_return_val_if_fail(addr != NULL, FALSE);
pid = fork();
if (pid > 0) {
/* parent */
pidwait_add(pid);
return pid;
}
if (pid != 0) {
/* failed! */
g_warning("net_connect_thread(): fork() failed! "
"Using blocking resolving");
}
/* child */
srand(time(NULL));
memset(&rec, 0, sizeof(rec));
rec.error = net_gethostbyname(addr, &rec.ip4, &rec.ip6);
if (rec.error == 0) {
errorstr = NULL;
} else {
errorstr = net_gethosterror(rec.error);
rec.errlen = errorstr == NULL ? 0 : strlen(errorstr)+1;
}
i_io_channel_write_block(pipe, &rec, sizeof(rec));
if (rec.errlen != 0)
i_io_channel_write_block(pipe, (void *) errorstr, rec.errlen);
if (pid == 0)
_exit(99);
/* we used blocking lookup */
return 0;
}
/* get the resolved IP address */
int net_gethostbyname_return(GIOChannel *pipe, RESOLVED_IP_REC *rec)
{
rec->error = -1;
rec->errorstr = NULL;
fcntl(g_io_channel_unix_get_fd(pipe), F_SETFL, O_NONBLOCK);
/* get ip+error */
if (i_io_channel_read_block(pipe, rec, sizeof(*rec)) == -1) {
rec->errorstr = g_strdup_printf("Host name lookup: %s",
g_strerror(errno));
return -1;
}
if (rec->error) {
/* read error string, if we can't read everything for some
reason, just ignore it. */
rec->errorstr = g_malloc0(rec->errlen+1);
i_io_channel_read_block(pipe, rec->errorstr, rec->errlen);
}
return 0;
}
/* Kill the resolver child */
void net_disconnect_nonblock(int pid)
{
g_return_if_fail(pid > 0);
kill(pid, SIGKILL);
resolver = g_resolver_get_default();
cancellable = g_cancellable_new();
data = g_new0(NET_GETHOSTBYNAME_CALLBACK_DATA, 1);
data->flags = flags;
data->cont = cont;
data->cont_data = cont_data;
#if GLIB_CHECK_VERSION(2, 59, 0)
g_resolver_lookup_by_name_with_flags_async(resolver, addr, flags, cancellable,
(GAsyncReadyCallback) net_gethostbyname_callback,
data);
#else
/* compatibility code for old GLib */
g_resolver_lookup_by_name_async(resolver, addr, cancellable,
(GAsyncReadyCallback) net_gethostbyname_callback, data);
#endif
return cancellable;
}

View file

@ -3,20 +3,10 @@
#include <irssi/src/core/network.h>
typedef struct {
IPADDR ip4, ip6; /* resolved ip addresses */
int error; /* error, 0 = no error, -1 = error: */
int errlen; /* error text length */
char *errorstr; /* error string - dynamically allocated, you'll
need to free() it yourself unless it's NULL */
} RESOLVED_IP_REC;
typedef void (*NetGethostbynameContinuationFunc)(RESOLVED_IP_REC *, void *);
/* nonblocking gethostbyname(), PID of the resolver child is returned. */
int net_gethostbyname_nonblock(const char *addr, GIOChannel *pipe, int reverse_lookup);
/* get the resolved IP address. returns -1 if some error occurred with read() */
int net_gethostbyname_return(GIOChannel *pipe, RESOLVED_IP_REC *rec);
/* Kill the resolver child */
void net_disconnect_nonblock(int pid);
/* nonblocking gethostbyname(), Cancellable of the resolver child is returned. */
GCancellable *net_gethostbyname_nonblock(const char *addr, GResolverNameLookupFlags flags,
NetGethostbynameContinuationFunc cont, void *cont_data);
#endif

View file

@ -28,6 +28,7 @@
#include <irssi/src/core/tls.h>
#include <openssl/crypto.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <openssl/pem.h>
@ -751,44 +752,49 @@ static void set_server_temporary_key_info(TLS_REC *tls, SSL *ssl)
#ifdef SSL_get_server_tmp_key
/* Show ephemeral key information. */
EVP_PKEY *ephemeral_key = NULL;
/* OPENSSL_NO_EC is for solaris 11.3 (2016), github ticket #598 */
#ifndef OPENSSL_NO_EC
EC_KEY *ec_key = NULL;
#endif
char *ephemeral_key_algorithm = NULL;
char *cname = NULL;
int nid;
g_return_if_fail(tls != NULL);
g_return_if_fail(ssl != NULL);
if (SSL_get_server_tmp_key(ssl, &ephemeral_key)) {
switch (EVP_PKEY_id(ephemeral_key)) {
case EVP_PKEY_DH:
tls_rec_set_ephemeral_key_algorithm(tls, "DH");
tls_rec_set_ephemeral_key_size(tls, EVP_PKEY_bits(ephemeral_key));
break;
int keytype = EVP_PKEY_id(ephemeral_key);
switch (keytype) {
case EVP_PKEY_DH:
tls_rec_set_ephemeral_key_algorithm(tls, "DH");
tls_rec_set_ephemeral_key_size(tls, EVP_PKEY_bits(ephemeral_key));
break;
/* OPENSSL_NO_EC is for solaris 11.3 (2016), github ticket #598 */
#ifndef OPENSSL_NO_EC
case EVP_PKEY_EC:
ec_key = EVP_PKEY_get1_EC_KEY(ephemeral_key);
nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key));
EC_KEY_free(ec_key);
cname = (char *)OBJ_nid2sn(nid);
ephemeral_key_algorithm = g_strdup_printf("ECDH: %s", cname);
case EVP_PKEY_EC: {
#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
char cname[50];
EVP_PKEY_get_group_name(ephemeral_key, cname, sizeof(cname), NULL);
#else
EC_KEY *ec_key = NULL;
char *cname = NULL;
int nid;
tls_rec_set_ephemeral_key_algorithm(tls, ephemeral_key_algorithm);
tls_rec_set_ephemeral_key_size(tls, EVP_PKEY_bits(ephemeral_key));
ec_key = EVP_PKEY_get1_EC_KEY(ephemeral_key);
nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key));
EC_KEY_free(ec_key);
cname = (char *) OBJ_nid2sn(nid);
#endif
ephemeral_key_algorithm = g_strdup_printf("ECDH: %s", cname);
g_free_and_null(ephemeral_key_algorithm);
break;
tls_rec_set_ephemeral_key_algorithm(tls, ephemeral_key_algorithm);
tls_rec_set_ephemeral_key_size(tls, EVP_PKEY_bits(ephemeral_key));
g_free_and_null(ephemeral_key_algorithm);
break;
}
#endif
default:
tls_rec_set_ephemeral_key_algorithm(tls, "Unknown");
tls_rec_set_ephemeral_key_size(tls, EVP_PKEY_bits(ephemeral_key));
break;
default:
tls_rec_set_ephemeral_key_algorithm(tls, OBJ_nid2ln(keytype));
tls_rec_set_ephemeral_key_size(tls, EVP_PKEY_bits(ephemeral_key));
break;
}
EVP_PKEY_free(ephemeral_key);

View file

@ -81,27 +81,14 @@ int i_io_channel_read_block(GIOChannel *channel, void *data, int len)
return received < len ? -1 : 0;
}
IPADDR ip4_any = {
AF_INET,
IPADDR ip4_any = { AF_INET,
#if defined(IN6ADDR_ANY_INIT)
IN6ADDR_ANY_INIT
IN6ADDR_ANY_INIT
#else
{ INADDR_ANY }
{ INADDR_ANY }
#endif
};
int net_ip_compare(IPADDR *ip1, IPADDR *ip2)
{
if (ip1->family != ip2->family)
return 0;
if (ip1->family == AF_INET6)
return memcmp(&ip1->ip, &ip2->ip, sizeof(ip1->ip)) == 0;
return memcmp(&ip1->ip, &ip2->ip, 4) == 0;
}
static void sin_set_ip(union sockaddr_union *so, const IPADDR *ip)
{
if (ip == NULL) {
@ -392,95 +379,119 @@ int net_getsockname(GIOChannel *handle, IPADDR *addr, int *port)
return 0;
}
/* Get IP addresses for host, both IPv4 and IPv6 if possible.
If ip->family is 0, the address wasn't found.
Returns 0 = ok, others = error code for net_gethosterror() */
int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
void resolved_ip_ref(RESOLVED_IP_REC *iprec)
{
union sockaddr_union *so;
struct addrinfo hints, *ai, *ailist;
int ret, count_v4, count_v6, use_v4, use_v6;
iprec->refcount++;
}
int resolved_ip_unref(RESOLVED_IP_REC *iprec)
{
if (--iprec->refcount > 0) {
return TRUE;
}
g_resolver_free_addresses(iprec->ailist);
if (iprec->error != NULL) {
g_error_free(iprec->error);
}
g_free(iprec);
return FALSE;
}
/* Get IP addresses for host, both IPv4 and IPv6 if possible. */
static RESOLVED_IP_REC *net_gethostbyname(const char *addr, GResolverNameLookupFlags flags)
{
/* GList<GInetAddress> */
GList *ailist;
GError *error;
GResolver *resolver;
RESOLVED_IP_REC *iprec;
g_return_val_if_fail(addr != NULL, NULL);
error = NULL;
resolver = g_resolver_get_default();
#if GLIB_CHECK_VERSION(2, 59, 0)
ailist = g_resolver_lookup_by_name_with_flags(resolver, addr, flags, NULL, &error);
#else
/* compatibility code for old GLib */
ailist = g_resolver_lookup_by_name(resolver, addr, NULL, &error);
if (error == NULL && flags) {
GList *ll, *lll;
for (ll = ailist; ll != NULL; ll = lll) {
GInetAddress *address;
GSocketFamily family;
address = G_INET_ADDRESS(ll->data);
family = g_inet_address_get_family(address);
lll = ll->next;
if ((flags == G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY &&
family == G_SOCKET_FAMILY_IPV6) ||
(flags == G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY &&
family == G_SOCKET_FAMILY_IPV4)) {
g_object_unref(address);
ailist = g_list_delete_link(ailist, ll);
}
}
if (ailist == NULL) {
g_set_error(&error, G_RESOLVER_ERROR, G_RESOLVER_ERROR_NOT_FOUND,
flags == G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY ?
"IPv4 address not found for host" :
"IPv6 address not found for host");
}
}
#endif
iprec = g_new0(RESOLVED_IP_REC, 1);
if (error != NULL) {
iprec->error = error;
} else {
iprec->ailist = ailist;
}
g_object_unref(resolver);
resolved_ip_ref(iprec);
return iprec;
}
int net_gethostbyname_first_ips(const char *addr, GResolverNameLookupFlags flags, IPADDR *ip4,
IPADDR *ip6)
{
RESOLVED_IP_REC *iprec;
#ifdef HAVE_CAPSICUM
if (capsicum_enabled())
return (capsicum_net_gethostbyname(addr, ip4, ip6));
#endif
g_return_val_if_fail(addr != NULL, -1);
iprec = net_gethostbyname(addr, flags);
if (iprec->error == NULL) {
GList *curr;
memset(ip4, 0, sizeof(IPADDR));
memset(ip6, 0, sizeof(IPADDR));
for (curr = iprec->ailist; curr; curr = curr->next) {
unsigned short family;
GInetAddress *addr;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_ADDRCONFIG;
/* save error to host_error for later use */
ret = getaddrinfo(addr, NULL, &hints, &ailist);
if (ret != 0)
return ret;
/* count IPs */
count_v4 = count_v6 = 0;
for (ai = ailist; ai != NULL; ai = ai->ai_next) {
if (ai->ai_family == AF_INET)
count_v4++;
else if (ai->ai_family == AF_INET6)
count_v6++;
}
if (count_v4 == 0 && count_v6 == 0)
return HOST_NOT_FOUND; /* shouldn't happen? */
/* if there are multiple addresses, return random one */
use_v4 = count_v4 <= 1 ? 0 : rand() % count_v4;
use_v6 = count_v6 <= 1 ? 0 : rand() % count_v6;
count_v4 = count_v6 = 0;
for (ai = ailist; ai != NULL; ai = ai->ai_next) {
so = (union sockaddr_union *) ai->ai_addr;
if (ai->ai_family == AF_INET) {
if (use_v4 == count_v4)
sin_get_ip(so, ip4);
count_v4++;
} else if (ai->ai_family == AF_INET6) {
if (use_v6 == count_v6)
sin_get_ip(so, ip6);
count_v6++;
addr = curr->data;
family = g_inet_address_get_family(addr);
if (ip4->family == 0 && family == AF_INET) {
ip4->family = AF_INET;
memcpy(&ip4->ip, g_inet_address_to_bytes(addr), sizeof(ip4->ip));
} else if (ip6->family == 0 && family == AF_INET6) {
ip6->family = AF_INET6;
memcpy(&ip6->ip, g_inet_address_to_bytes(addr), sizeof(ip6->ip));
}
}
resolved_ip_unref(iprec);
return 0;
} else {
resolved_ip_unref(iprec);
return -1;
}
freeaddrinfo(ailist);
return 0;
}
/* Get name for host, *name should be g_free()'d unless it's NULL.
Return values are the same as with net_gethostbyname() */
int net_gethostbyaddr(IPADDR *ip, char **name)
{
union sockaddr_union so;
int host_error;
char hostname[NI_MAXHOST];
g_return_val_if_fail(ip != NULL, -1);
g_return_val_if_fail(name != NULL, -1);
*name = NULL;
memset(&so, 0, sizeof(so));
sin_set_ip(&so, ip);
/* save error to host_error for later use */
host_error = getnameinfo((struct sockaddr *)&so, sizeof(so),
hostname, sizeof(hostname),
NULL, 0,
NI_NAMEREQD);
if (host_error != 0)
return host_error;
*name = g_strdup(hostname);
return 0;
}
int net_ip2host(IPADDR *ip, char *host)
@ -491,8 +502,6 @@ int net_ip2host(IPADDR *ip, char *host)
int net_host2ip(const char *host, IPADDR *ip)
{
unsigned long addr;
if (strchr(host, ':') != NULL) {
/* IPv6 */
ip->family = AF_INET6;
@ -501,16 +510,8 @@ int net_host2ip(const char *host, IPADDR *ip)
} else {
/* IPv4 */
ip->family = AF_INET;
#ifdef HAVE_INET_ATON
if (inet_aton(host, &ip->ip.s_addr) == 0)
if (inet_pton(AF_INET, host, &ip->ip) == 0)
return -1;
#else
addr = inet_addr(host);
if (addr == INADDR_NONE)
return -1;
memcpy(&ip->ip, &addr, 4);
#endif
}
return 0;
@ -529,29 +530,6 @@ int net_geterror(GIOChannel *handle)
return data;
}
/* get error of net_gethostname() */
const char *net_gethosterror(int error)
{
g_return_val_if_fail(error != 0, NULL);
if (error == EAI_SYSTEM) {
return strerror(errno);
} else {
return gai_strerror(error);
}
}
/* return TRUE if host lookup failed because it didn't exist (ie. not
some error with name server) */
int net_hosterror_notfound(int error)
{
#ifdef EAI_NODATA /* NODATA is deprecated */
return error != 1 && (error == EAI_NONAME || error == EAI_NODATA);
#else
return error != 1 && (error == EAI_NONAME);
#endif
}
/* Get name of TCP service */
char *net_getservbyport(int port)
{

View file

@ -1,15 +1,12 @@
#ifndef IRSSI_CORE_NETWORK_H
#define IRSSI_CORE_NETWORK_H
#ifdef HAVE_SOCKS_H
#include <socks.h>
#endif
#include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netdb.h>
# include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <irssi/src/common.h>
#ifndef AF_INET6
# ifdef PF_INET6
@ -19,11 +16,31 @@
# endif
#endif
#if GLIB_CHECK_VERSION(2, 59, 0)
/* nothing */
#else
/* compatibility code for old GLib */
typedef enum {
G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT = 0,
G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY = 1 << 0,
G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY = 1 << 1,
} GResolverNameLookupFlags;
#endif
struct _IPADDR {
unsigned short family;
struct in6_addr ip;
};
typedef struct {
int refcount;
/* GList<GInetAddress> */
GList *ailist; /* needs to be freed */
GError *error; /* needs to be freed */
} RESOLVED_IP_REC;
/* maxmimum string length of IP address */
#define MAX_IP_LEN INET6_ADDRSTRLEN
@ -33,9 +50,7 @@ extern IPADDR ip4_any;
GIOChannel *i_io_channel_new(int handle);
/* Returns 1 if IPADDRs are the same. */
/* Deprecated since it is unused. It will be deleted in a later release. */
int net_ip_compare(IPADDR *ip1, IPADDR *ip2) G_GNUC_DEPRECATED;
/* OTR */
int i_io_channel_write_block(GIOChannel *channel, void *data, int len);
int i_io_channel_read_block(GIOChannel *channel, void *data, int len);
@ -64,18 +79,9 @@ 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);
/* Get IP addresses for host, both IPv4 and IPv6 if possible.
If ip->family is 0, the address wasn't found.
Returns 0 = ok, others = error code for net_gethosterror() */
int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6);
/* Get name for host, *name should be g_free()'d unless it's NULL.
Return values are the same as with net_gethostbyname() */
int net_gethostbyaddr(IPADDR *ip, char **name);
/* get error of net_gethostname() */
const char *net_gethosterror(int error);
/* return TRUE if host lookup failed because it didn't exist (ie. not
some error with name server) */
int net_hosterror_notfound(int error);
/* Get the first IP address for host, both IPv4 and IPv6 if possible. */
int net_gethostbyname_first_ips(const char *addr, GResolverNameLookupFlags flags, IPADDR *ip4,
IPADDR *ip6);
/* Get socket address/port */
int net_getsockname(GIOChannel *handle, IPADDR *addr, int *port);
@ -94,4 +100,7 @@ char *net_getservbyport(int port);
int is_ipv4_address(const char *host);
int is_ipv6_address(const char *host);
void resolved_ip_ref(RESOLVED_IP_REC *iprec);
int resolved_ip_unref(RESOLVED_IP_REC *iprec);
#endif

View file

@ -12,6 +12,7 @@ char *proxy_string, *proxy_string_after, *proxy_password;
unsigned short family; /* 0 = don't care, AF_INET or AF_INET6 */
unsigned short chosen_family; /* family actually chosen during name resolution */
char *ipaddr;
char *tag; /* try to keep this tag when connected to server */
char *address;
int port;
@ -44,6 +45,8 @@ unsigned int unix_socket:1; /* Connect using named unix socket */
unsigned int use_tls:1; /* this connection uses TLS */
unsigned int tls_verify:1;
unsigned int no_connect:1; /* don't connect() at all, it's done by plugin */
unsigned short last_failed_family; /* #641: if we failed to connect to ipv6, try ipv4 and vice versa */
int last_connected;
int last_failed;
RESOLVED_IP_REC *resolved_host;
char *channels;
char *away_reason;

View file

@ -21,10 +21,8 @@ unsigned int no_reconnect:1; /* Don't reconnect to server */
NET_SENDBUF_REC *handle;
int readtag; /* input tag */
/* for net_gethostbyname_return() */
GIOChannel *connect_pipe[2];
GCancellable *connect_cancellable;
int connect_tag;
int connect_pid;
RAWLOG_REC *rawlog;
GHashTable *module_data;

View file

@ -120,6 +120,10 @@ static int server_reconnect_timeout(void)
if (server->connect_tag != -1) {
g_source_remove(server->connect_tag);
server->connect_tag = -1;
} else if (server->connect_cancellable != NULL) {
g_cancellable_cancel(server->connect_cancellable);
g_object_unref(server->connect_cancellable);
server->connect_cancellable = NULL;
}
server->connection_lost = TRUE;
server_connect_failed(server, "Timeout");
@ -168,7 +172,8 @@ server_connect_copy_skeleton(SERVER_CONNECT_REC *src, int connect_info)
server_connect_ref(dest);
dest->type = module_get_uniq_id("SERVER CONNECT", 0);
dest->reconnection = src->reconnection;
dest->last_failed_family = src->last_failed_family;
dest->last_connected = src->last_connected;
dest->last_failed = src->last_failed;
dest->proxy = g_strdup(src->proxy);
dest->proxy_port = src->proxy_port;
dest->proxy_string = g_strdup(src->proxy_string);
@ -207,6 +212,10 @@ server_connect_copy_skeleton(SERVER_CONNECT_REC *src, int connect_info)
dest->own_ip6 = g_new(IPADDR, 1);
memcpy(dest->own_ip6, src->own_ip6, sizeof(IPADDR));
}
dest->resolved_host = src->resolved_host;
if (dest->resolved_host != NULL) {
resolved_ip_ref(dest->resolved_host);
}
dest->channels = g_strdup(src->channels);
dest->away_reason = g_strdup(src->away_reason);

View file

@ -58,7 +58,8 @@ static void save_ips(IPADDR *ip4, IPADDR *ip6,
static void get_source_host_ip(void)
{
const char *hostname;
IPADDR ip4, ip6;
IPADDR ip4 = { 0 };
IPADDR ip6 = { 0 };
if (source_host_ok)
return;
@ -66,25 +67,28 @@ static void get_source_host_ip(void)
/* FIXME: This will block! */
hostname = settings_get_str("hostname");
source_host_ok = *hostname != '\0' &&
net_gethostbyname(hostname, &ip4, &ip6) == 0;
net_gethostbyname_first_ips(hostname, G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT,
&ip4, &ip6) == 0;
if (source_host_ok)
if (source_host_ok) {
save_ips(&ip4, &ip6, &source_host_ip4, &source_host_ip6);
else {
g_free_and_null(source_host_ip4);
g_free_and_null(source_host_ip6);
} else {
g_free_and_null(source_host_ip4);
g_free_and_null(source_host_ip6);
}
}
static void conn_set_ip(SERVER_CONNECT_REC *conn, const char *own_host,
IPADDR **own_ip4, IPADDR **own_ip6)
{
IPADDR ip4, ip6;
IPADDR ip4 = { 0 };
IPADDR ip6 = { 0 };
if (*own_ip4 == NULL && *own_ip6 == NULL) {
/* resolve the IP */
if (net_gethostbyname(own_host, &ip4, &ip6) == 0)
save_ips(&ip4, &ip6, own_ip4, own_ip6);
if (net_gethostbyname_first_ips(own_host, G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT,
&ip4, &ip6) == 0)
save_ips(&ip4, &ip6, own_ip4, own_ip6);
}
server_connect_own_ip_save(conn, *own_ip4, *own_ip6);
@ -305,6 +309,13 @@ static SERVER_CONNECT_REC *create_addr_conn(int chat_type, const char *address,
proto = chat_type >= 0 ? chat_protocol_find_id(chat_type) :
chat_protocol_get_default();
if (proto == NULL) {
signal_stop();
return NULL;
}
g_return_val_if_fail(proto != NULL, NULL);
conn = proto->create_server_connect();
server_connect_ref(conn);
@ -446,6 +457,7 @@ static SERVER_SETUP_REC *server_setup_read(CONFIG_NODE *node)
{
SERVER_SETUP_REC *rec;
CHATNET_REC *chatnetrec;
CHAT_PROTOCOL_REC *proto;
char *server, *chatnet, *family;
int port;
char *value = NULL;
@ -466,23 +478,40 @@ static SERVER_SETUP_REC *server_setup_read(CONFIG_NODE *node)
rec = NULL;
chatnetrec = chatnet == NULL ? NULL : chatnet_find(chatnet);
if (chatnetrec == NULL && chatnet != NULL) {
/* chat network not found, create it. */
chatnetrec = chat_protocol_get_default()->create_chatnet();
chatnetrec->chat_type = chat_protocol_get_default()->id;
chatnetrec->name = g_strdup(chatnet);
chatnet_create(chatnetrec);
if (chatnet != NULL) {
chatnetrec = chatnet_find(chatnet);
if (chatnetrec != NULL) {
proto = CHAT_PROTOCOL(chatnetrec);
} else {
/* chat network not found, create it. */
if (chatnet_find_unavailable(chatnet)) {
/* no protocols loaded, skip loading servers */
return NULL;
}
proto = chat_protocol_get_default();
chatnetrec = proto->create_chatnet();
chatnetrec->chat_type = chat_protocol_get_default()->id;
chatnetrec->name = g_strdup(chatnet);
chatnet_create(chatnetrec);
}
} else {
chatnetrec = NULL;
proto = chat_protocol_get_default();
if (proto == NULL) {
/* no protocols loaded, skip loading servers */
return NULL;
}
}
family = config_node_get_str(node, "family", "");
rec = CHAT_PROTOCOL(chatnetrec)->create_server_setup();
rec = proto->create_server_setup();
rec->type = module_get_uniq_id("SERVER SETUP", 0);
rec->chat_type = CHAT_PROTOCOL(chatnetrec)->id;
rec->chat_type = proto->id;
rec->chatnet = chatnetrec == NULL ? NULL : g_strdup(chatnetrec->name);
rec->family = g_ascii_strcasecmp(family, "inet6") == 0 ? AF_INET6 :
(g_ascii_strcasecmp(family, "inet") == 0 ? AF_INET : 0);
rec->family = g_ascii_strcasecmp(family, "inet6") == 0 ?
AF_INET6 :
(g_ascii_strcasecmp(family, "inet") == 0 ? AF_INET : 0);
rec->address = g_strdup(server);
rec->password = g_strdup(config_node_get_str(node, "password", NULL));
@ -759,8 +788,7 @@ void servers_setup_init(void)
read_settings();
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
signal_add("setup reread", (SIGNAL_FUNC) read_servers);
signal_add("irssi init read settings", (SIGNAL_FUNC) read_servers);
signal_add("setup reread servers", (SIGNAL_FUNC) read_servers);
}
void servers_setup_deinit(void)
@ -773,8 +801,7 @@ void servers_setup_deinit(void)
server_setup_destroy(setupservers->data);
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
signal_remove("setup reread", (SIGNAL_FUNC) read_servers);
signal_remove("irssi init read settings", (SIGNAL_FUNC) read_servers);
signal_remove("setup reread servers", (SIGNAL_FUNC) read_servers);
module_uniq_destroy("SERVER SETUP");
}

View file

@ -51,20 +51,16 @@ void server_connect_failed(SERVER_REC *server, const char *msg)
g_source_remove(server->connect_tag);
server->connect_tag = -1;
}
if (server->connect_cancellable != NULL) {
g_cancellable_cancel(server->connect_cancellable);
g_object_unref(server->connect_cancellable);
server->connect_cancellable = NULL;
}
if (server->handle != NULL) {
net_sendbuffer_destroy(server->handle, TRUE);
server->handle = NULL;
}
if (server->connect_pipe[0] != NULL) {
g_io_channel_shutdown(server->connect_pipe[0], TRUE, NULL);
g_io_channel_unref(server->connect_pipe[0]);
g_io_channel_shutdown(server->connect_pipe[1], TRUE, NULL);
g_io_channel_unref(server->connect_pipe[1]);
server->connect_pipe[0] = NULL;
server->connect_pipe[1] = NULL;
}
server_unref(server);
}
@ -134,8 +130,7 @@ static char *server_create_tag(SERVER_CONNECT_REC *conn)
}
g_free(tag);
tag = str->str;
g_string_free(str, FALSE);
tag = g_string_free(str, FALSE);
return tag;
}
@ -157,7 +152,7 @@ static void server_connect_callback_init(SERVER_REC *server, GIOChannel *handle)
error = net_geterror(handle);
if (error != 0) {
server->connection_lost = TRUE;
server->connrec->last_failed_family = server->connrec->chosen_family;
server->connrec->last_failed = server->connrec->last_connected;
server_connect_failed(server, g_strerror(error));
return;
}
@ -178,7 +173,7 @@ static void server_connect_callback_init_ssl(SERVER_REC *server, GIOChannel *han
error = irssi_ssl_handshake(handle);
if (error == -1) {
server->connection_lost = TRUE;
server->connrec->last_failed_family = server->connrec->chosen_family;
server->connrec->last_failed = server->connrec->last_connected;
server_connect_failed(server, NULL);
return;
}
@ -212,13 +207,18 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip,
g_return_if_fail(ip != NULL || unix_socket != NULL);
if (ip != NULL) {
server->connrec->chosen_family = ip->family;
net_ip2host(ip, ipaddr);
server->connrec->ipaddr = g_strdup(ipaddr);
}
signal_emit("server connecting", 2, server, ip);
if (server->connrec->no_connect)
return;
if (ip != NULL) {
server->connrec->chosen_family = ip->family;
own_ip = IPADDR_IS_V6(ip) ? server->connrec->own_ip6 : server->connrec->own_ip4;
port = server->connrec->proxy != NULL ?
server->connrec->proxy_port : server->connrec->port;
@ -255,12 +255,12 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip,
server->connection_lost = TRUE;
if (ip != NULL) {
server->connrec->last_failed_family = ip->family;
server->connrec->last_failed = server->connrec->last_connected;
}
server_connect_failed(server, errmsg2 ? errmsg2 : errmsg);
g_free(errmsg2);
} else {
server->connrec->last_failed_family = 0;
server->connrec->last_failed = 0;
if (!server->connrec->use_tls)
server->handle = net_sendbuffer_create(handle, 0);
if (server->connrec->use_tls)
@ -272,48 +272,47 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip,
}
}
static void server_connect_callback_readpipe(SERVER_REC *server)
static int server_start_connect_resolve(SERVER_REC *server);
static void server_connect_use_resolved(SERVER_REC *server)
{
RESOLVED_IP_REC iprec;
IPADDR *ip;
IPADDR *ip;
const char *errormsg;
RESOLVED_IP_REC *iprec = server->connrec->resolved_host;
g_source_remove(server->connect_tag);
server->connect_tag = -1;
net_gethostbyname_return(server->connect_pipe[0], &iprec);
g_io_channel_shutdown(server->connect_pipe[0], TRUE, NULL);
g_io_channel_unref(server->connect_pipe[0]);
g_io_channel_shutdown(server->connect_pipe[1], TRUE, NULL);
g_io_channel_unref(server->connect_pipe[1]);
server->connect_pipe[0] = NULL;
server->connect_pipe[1] = NULL;
/* figure out if we should use IPv4 or v6 address */
if (iprec.error != 0) {
/* error */
if (iprec->error != NULL) {
/* error */
ip = NULL;
} else if (server->connrec->family == AF_INET) {
/* force IPv4 connection */
ip = iprec.ip4.family == 0 ? NULL : &iprec.ip4;
} else if (server->connrec->family == AF_INET6) {
/* force IPv6 connection */
ip = iprec.ip6.family == 0 ? NULL : &iprec.ip6;
} else {
/* pick the one that was found. if both were found:
1. disprefer the last one that failed
2. prefer ipv4 over ipv6 unless resolve_prefer_ipv6 is set
*/
if (iprec.ip4.family == 0 ||
(iprec.ip6.family != 0 &&
(server->connrec->last_failed_family == AF_INET ||
(settings_get_bool("resolve_prefer_ipv6") &&
server->connrec->last_failed_family != AF_INET6)))) {
ip = &iprec.ip6;
GList *curr;
int i;
curr = iprec->ailist;
i = 0;
while (i < server->connrec->last_failed) {
if (curr != NULL) {
curr = curr->next;
i++;
}
/* curr is different now */
if (curr == NULL) {
resolved_ip_unref(server->connrec->resolved_host);
server->connrec->resolved_host = NULL;
server->connrec->last_failed = 0;
/* retry resolve */
server_start_connect_resolve(server);
return;
}
}
if (curr != NULL) {
GInetAddress *addr;
addr = curr->data;
server->connrec->last_connected = i + 1;
ip = g_new0(IPADDR, 1);
ip->family = g_inet_address_get_family(addr);
memcpy(&ip->ip, g_inet_address_to_bytes(addr), sizeof(ip->ip));
} else {
ip = &iprec.ip4;
ip = NULL;
}
}
@ -322,28 +321,69 @@ static void server_connect_callback_readpipe(SERVER_REC *server)
server_real_connect(server, ip, NULL);
errormsg = NULL;
} else {
if (iprec.error == 0 || net_hosterror_notfound(iprec.error)) {
if (iprec->error->code == G_RESOLVER_ERROR_NOT_FOUND) {
/* IP wasn't found for the host, don't try to
reconnect back to this server */
server->dns_error = TRUE;
}
if (iprec.error == 0) {
/* forced IPv4 or IPv6 address but it wasn't found */
errormsg = server->connrec->family == AF_INET ?
"IPv4 address not found for host" :
"IPv6 address not found for host";
} else {
/* gethostbyname() failed */
errormsg = iprec.errorstr != NULL ? iprec.errorstr :
"Host lookup failed";
}
errormsg = iprec->error->message;
if (errormsg == NULL)
errormsg = "Host lookup failed";
server->connection_lost = TRUE;
/* clear the error in resolved_host */
server->connrec->resolved_host = NULL;
server_connect_failed(server, errormsg);
resolved_ip_unref(iprec);
}
g_free(iprec.errorstr);
g_free(ip);
}
static void server_connect_callback_resolved(RESOLVED_IP_REC *iprec, SERVER_REC *server)
{
if (server->connect_cancellable != NULL) {
g_object_unref(server->connect_cancellable);
server->connect_cancellable = NULL;
}
if (server->connrec->resolved_host != NULL) {
resolved_ip_unref(server->connrec->resolved_host);
}
server->connrec->resolved_host = iprec;
if (iprec->error == NULL && iprec->ailist == NULL) {
server->connection_lost = TRUE;
server->dns_error = TRUE;
server_connect_failed(server, "Host lookup failed");
} else {
server_connect_use_resolved(server);
}
}
static int server_start_connect_resolve(SERVER_REC *server)
{
const char *connect_address;
GResolverNameLookupFlags net_gethostbyname_flags;
connect_address =
server->connrec->proxy != NULL ? server->connrec->proxy : server->connrec->address;
net_gethostbyname_flags = G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT;
if (server->connrec->family == AF_INET) {
net_gethostbyname_flags = G_RESOLVER_NAME_LOOKUP_FLAGS_IPV4_ONLY;
} else if (server->connrec->family == AF_INET6) {
net_gethostbyname_flags = G_RESOLVER_NAME_LOOKUP_FLAGS_IPV6_ONLY;
}
if (server->connrec->resolved_host == NULL) {
server->connect_cancellable = net_gethostbyname_nonblock(
connect_address, net_gethostbyname_flags,
(NetGethostbynameContinuationFunc) server_connect_callback_resolved, server);
return FALSE;
} else {
return TRUE;
}
}
SERVER_REC *server_connect(SERVER_CONNECT_REC *conn)
@ -395,9 +435,6 @@ void server_connect_init(SERVER_REC *server)
/* starts connecting to server */
int server_start_connect(SERVER_REC *server)
{
const char *connect_address;
int fd[2];
g_return_val_if_fail(server != NULL, FALSE);
if (!server->connrec->unix_socket && server->connrec->port <= 0)
return FALSE;
@ -415,30 +452,17 @@ int server_start_connect(SERVER_REC *server)
/* connect with unix socket */
server_real_connect(server, NULL, server->connrec->address);
} else {
int already_resolved;
/* resolve host name */
if (pipe(fd) != 0) {
g_warning("server_connect(): pipe() failed.");
g_free(server->tag);
g_free(server->nick);
return FALSE;
}
server->connect_pipe[0] = i_io_channel_new(fd[0]);
server->connect_pipe[1] = i_io_channel_new(fd[1]);
connect_address = server->connrec->proxy != NULL ?
server->connrec->proxy : server->connrec->address;
server->connect_pid =
net_gethostbyname_nonblock(connect_address,
server->connect_pipe[1], 0);
server->connect_tag =
i_input_add(server->connect_pipe[0], I_INPUT_READ,
(GInputFunction) server_connect_callback_readpipe, server);
already_resolved = server_start_connect_resolve(server);
server->connect_time = time(NULL);
lookup_servers = g_slist_append(lookup_servers, server);
signal_emit("server looking", 1, server);
if (already_resolved) {
server_connect_use_resolved(server);
}
}
return TRUE;
}
@ -477,8 +501,9 @@ void server_disconnect(SERVER_REC *server)
if (server->connect_tag != -1) {
/* still connecting to server.. */
if (server->connect_pid != -1)
net_disconnect_nonblock(server->connect_pid);
server_connect_failed(server, NULL);
return;
} else if (server->connect_cancellable != NULL) {
server_connect_failed(server, NULL);
return;
}
@ -637,6 +662,7 @@ void server_connect_unref(SERVER_CONNECT_REC *conn)
g_free_not_null(conn->proxy_string_after);
g_free_not_null(conn->proxy_password);
g_free_not_null(conn->ipaddr);
g_free_not_null(conn->tag);
g_free_not_null(conn->address);
g_free_not_null(conn->chatnet);
@ -644,6 +670,10 @@ void server_connect_unref(SERVER_CONNECT_REC *conn)
g_free_not_null(conn->own_ip4);
g_free_not_null(conn->own_ip6);
if (conn->resolved_host != NULL) {
resolved_ip_unref(conn->resolved_host);
}
g_free_not_null(conn->password);
g_free_not_null(conn->nick);
g_free_not_null(conn->username);
@ -764,7 +794,6 @@ static void sig_chat_protocol_deinit(CHAT_PROTOCOL_REC *proto)
void servers_init(void)
{
settings_add_bool("server", "resolve_prefer_ipv6", FALSE);
lookup_servers = servers = NULL;
signal_add("chat protocol deinit", (SIGNAL_FUNC) sig_chat_protocol_deinit);

View file

@ -2,6 +2,7 @@
#define IRSSI_CORE_SERVERS_H
#include <irssi/src/core/modules.h>
#include <irssi/src/core/network.h>
/* Returns SERVER_REC if it's server, NULL if it isn't. */
#define SERVER(server) \

View file

@ -673,18 +673,6 @@ GSList *settings_get_sorted(void)
return list;
}
void sig_term(int n)
{
/* if we get SIGTERM after this, just die instead of coming back here. */
signal(SIGTERM, SIG_DFL);
/* quit from all servers too.. */
signal_emit("command quit", 1, "");
/* and die */
raise(SIGTERM);
}
/* Yes, this is my own stupid checksum generator, some "real" algorithm
would be nice but would just take more space without much real benefit */
static unsigned int file_checksum(const char *fname)
@ -805,8 +793,6 @@ static void init_configfile(void)
signal_emit("gui dialog", 2, "error", str);
g_free(str);
}
signal(SIGTERM, sig_term);
}
int settings_reread(const char *fname)

View file

@ -88,8 +88,7 @@ static char *get_argument(char **cmd, char **arglist)
}
if (str->len > 0) g_string_truncate(str, str->len-1);
ret = str->str;
g_string_free(str, FALSE);
ret = g_string_free_and_steal(str);
return ret;
}
@ -412,8 +411,7 @@ char *get_alignment(const char *text, int align, int flags, char pad)
}
}
ret = str->str;
g_string_free(str, FALSE);
ret = g_string_free_and_steal(str);
return ret;
}
@ -604,8 +602,7 @@ char *parse_special_string(const char *cmd, SERVER_REC *server, void *item,
}
g_strfreev(arglist);
ret = str->str;
g_string_free(str, FALSE);
ret = g_string_free_and_steal(str);
return ret;
}

View file

@ -1,3 +0,0 @@
SUBDIRS = core irc
EXTRA_DIST = meson.build

View file

@ -1,73 +0,0 @@
noinst_LIBRARIES = libfe_common_core.a
AM_CPPFLAGS = \
-I$(top_builddir) \
$(GLIB_CFLAGS) \
-DHELPDIR=\""$(datadir)/irssi/help"\" \
-DTHEMESDIR=\""$(datadir)/irssi/themes"\"
libfe_common_core_a_SOURCES = \
chat-completion.c \
command-history.c \
completion.c \
fe-channels.c \
fe-common-core.c \
fe-core-commands.c \
fe-exec.c \
fe-expandos.c \
fe-help.c \
fe-ignore.c \
fe-ignore-messages.c \
fe-log.c \
fe-messages.c \
fe-modules.c \
fe-queries.c \
fe-server.c \
fe-settings.c \
fe-tls.c \
formats.c \
hilight-text.c \
keyboard.c \
module-formats.c \
printtext.c \
fe-recode.c \
themes.c \
window-activity.c \
window-commands.c \
window-items.c \
windows-layout.c \
fe-windows.c
if HAVE_CAPSICUM
libfe_common_core_a_SOURCES += \
fe-capsicum.c
endif
pkginc_fe_common_coredir=$(pkgincludedir)/src/fe-common/core
pkginc_fe_common_core_HEADERS = \
command-history.h \
chat-completion.h \
completion.h \
fe-capsicum.h \
fe-channels.h \
fe-common-core.h \
fe-core-commands.h \
fe-exec.h \
fe-messages.h \
fe-queries.h \
fe-settings.h \
fe-tls.h \
formats.h \
hilight-text.h \
keyboard.h \
module-formats.h \
module.h \
printtext.h \
fe-recode.h \
themes.h \
window-activity.h \
window-items.h \
windows-layout.h \
fe-windows.h
EXTRA_DIST = meson.build

View file

@ -261,7 +261,12 @@ static const char *command_history_prev_int(WINDOW_REC *window, const char *text
if (*text != '\0' &&
(pos == NULL || g_strcmp0(((HISTORY_ENTRY_REC *)pos->data)->text, text) != 0)) {
/* save the old entry to history */
command_history_add(history, text);
if (pos != NULL && settings_get_bool("command_history_editable")) {
history_entry_destroy(pos->data);
pos->data = history_entry_new(history, text);
} else {
command_history_add(history, text);
}
}
return history->pos == NULL ? text : ((HISTORY_ENTRY_REC *)history->pos->data)->text;
@ -292,7 +297,12 @@ static const char *command_history_next_int(WINDOW_REC *window, const char *text
if (*text != '\0' &&
(pos == NULL || g_strcmp0(((HISTORY_ENTRY_REC *)pos->data)->text, text) != 0)) {
/* save the old entry to history */
command_history_add(history, text);
if (pos != NULL && settings_get_bool("command_history_editable")) {
history_entry_destroy(pos->data);
pos->data = history_entry_new(history, text);
} else {
command_history_add(history, text);
}
}
return history->pos == NULL ? "" : ((HISTORY_ENTRY_REC *)history->pos->data)->text;
}
@ -467,6 +477,7 @@ void command_history_init(void)
{
settings_add_int("history", "max_command_history", 100);
settings_add_bool("history", "window_history", FALSE);
settings_add_bool("history", "command_history_editable", FALSE);
special_history_func_set(special_history_func);

View file

@ -111,8 +111,7 @@ char *auto_word_complete(const char *line, int *pos)
*pos = startpos+strlen(replace);
g_string_insert(result, startpos, replace);
ret = result->str;
g_string_free(result, FALSE);
ret = g_string_free_and_steal(result);
}
g_free(word);
@ -290,8 +289,7 @@ char *word_complete(WINDOW_REC *window, const char *line, int *pos, int erase, i
g_free_not_null(last_line);
last_line = g_strdup(result->str);
ret = result->str;
g_string_free(result, FALSE);
ret = g_string_free_and_steal(result);
/* free the data */
g_free(data);

View file

@ -646,7 +646,7 @@ void fe_channels_init(void)
command_bind("channel modify", NULL, (SIGNAL_FUNC) cmd_channel_modify);
command_bind("channel remove", NULL, (SIGNAL_FUNC) cmd_channel_remove);
command_bind("channel list", NULL, (SIGNAL_FUNC) cmd_channel_list);
command_bind("names", NULL, (SIGNAL_FUNC) cmd_names);
command_bind_first("names", NULL, (SIGNAL_FUNC) cmd_names);
command_bind("cycle", NULL, (SIGNAL_FUNC) cmd_cycle);
command_set_options("channel add", "auto noauto -bots -botcmd");

View file

@ -166,7 +166,7 @@ void fe_common_core_init(void)
settings_add_bool("lookandfeel", "use_msgs_window", FALSE);
g_get_charset(&str);
settings_add_str("lookandfeel", "term_charset", str);
settings_add_str("lookandfeel", "glib_log_domains", "all");
settings_add_str("lookandfeel", "glib_log_domains", "all -glib-gio:debug");
themes_init();
theme_register(fecommon_core_formats);
@ -258,13 +258,19 @@ void fe_common_core_deinit(void)
g_log_set_default_handler(logger_old, NULL);
}
static gboolean glib_domain_wanted(const char *domain)
static gboolean glib_domain_wanted(const char *domain, const char *level)
{
const char *domains;
char *c, *cur;
int len = 0;
int print_it = 0; /* -1 for exclude, 0 for undecided, 1 for include */
int incl;
char *domainlevel, *alllevel, *starlevel, *domainstar;
domainlevel = g_strdup_printf("%s:%s", domain, level);
alllevel = g_strdup_printf("all:%s", level);
starlevel = g_strdup_printf("*:%s", level);
domainstar = g_strdup_printf("%s:*", domain);
/* Go through each item in glib_log_domains setting to determine whether
* or not we want to print message from this domain */
@ -287,8 +293,10 @@ static gboolean glib_domain_wanted(const char *domain)
}
/* If we got a valid item, process it */
if (len > 0 && (!strncmp(domain, c, len) || !strncasecmp("all", c, len) ||
!strncmp("*", c, len)))
if (len > 0 && (!strncasecmp(domain, c, len) || !strncasecmp("all", c, len) ||
!strncmp("*", c, len) || !strncasecmp(domainstar, c, len) ||
!strncasecmp(domainlevel, c, len) ||
!strncasecmp(alllevel, c, len) || !strncasecmp(starlevel, c, len)))
print_it = incl;
/* Go past any spaces towards the next item */
@ -300,6 +308,11 @@ static gboolean glib_domain_wanted(const char *domain)
len = 0;
} while (*c != '\0' && print_it != -1);
g_free(domainlevel);
g_free(alllevel);
g_free(starlevel);
g_free(domainstar);
return (print_it == 1);
}
@ -333,7 +346,7 @@ static void i_log_func(const char *log_domain, GLogLevelFlags log_level, const c
domain = (log_domain ? log_domain : "default");
/* Only print the message if we decided to */
if (!glib_domain_wanted(domain))
if (!glib_domain_wanted(domain, reason))
return;
if (windows == NULL)

View file

@ -57,6 +57,7 @@ static int skip_next_printtext;
static char *log_theme_name;
static char **autolog_ignore_targets;
static GTimeZone *utc;
static char *log_colorizer_strip(const char *str)
{
@ -213,8 +214,7 @@ static char *log_items_get_list(LOG_REC *log)
if(rec->servertag != NULL)
g_string_append_printf(str, " (%s)", rec->servertag);
ret = str->str;
g_string_free(str, FALSE);
ret = g_string_free_and_steal(str);
return ret;
}
@ -547,7 +547,7 @@ static void log_line(TEXT_DEST_REC *dest, const char *text)
char *val;
if ((val = g_hash_table_lookup(dest->meta, "time")) != NULL) {
GDateTime *time;
if ((time = g_date_time_new_from_iso8601(val, NULL)) != NULL) {
if ((time = g_date_time_new_from_iso8601(val, utc)) != NULL) {
t = g_date_time_to_unix(time);
g_date_time_unref(time);
}
@ -745,6 +745,7 @@ void fe_log_init(void)
{
autoremove_tag = g_timeout_add(60000, (GSourceFunc) sig_autoremove, NULL);
skip_next_printtext = FALSE;
utc = g_time_zone_new_utc();
settings_add_bool("log", "awaylog_colors", TRUE);
settings_add_bool("log", "autolog", FALSE);
@ -812,6 +813,7 @@ void fe_log_deinit(void)
if (autolog_ignore_targets != NULL)
g_strfreev(autolog_ignore_targets);
g_time_zone_unref(utc);
g_free_not_null(autolog_path);
g_free_not_null(log_theme_name);
}

View file

@ -133,8 +133,7 @@ char *expand_emphasis(WI_ITEM_REC *item, const char *text)
}
}
ret = str->str;
g_string_free(str, FALSE);
ret = g_string_free_and_steal(str);
return ret;
}
@ -730,9 +729,8 @@ static void sig_nicklist_new(CHANNEL_REC *channel, NICK_REC *nick)
n++;
} while (printnick_exists(firstnick, nick, newnick->str));
g_hash_table_insert(printnicks, nick, newnick->str);
g_string_free(newnick, FALSE);
g_free(nickhost);
g_hash_table_insert(printnicks, nick, g_string_free_and_steal(newnick));
g_free(nickhost);
}
static void sig_nicklist_remove(CHANNEL_REC *channel, NICK_REC *nick)

View file

@ -29,8 +29,6 @@
#include <irssi/src/fe-common/core/printtext.h>
#ifdef HAVE_GMODULE
static void sig_module_error(void *number, const char *data,
const char *rootmodule, const char *submodule)
{
@ -273,22 +271,3 @@ void fe_modules_deinit(void)
command_unbind("load", (SIGNAL_FUNC) cmd_load);
command_unbind("unload", (SIGNAL_FUNC) cmd_unload);
}
#else /* !HAVE_GMODULE */
static void cmd_load(const char *data)
{
printtext(NULL, NULL, MSGLEVEL_CLIENTERROR,
"Dynamic modules loading not supported");
}
void fe_modules_init(void)
{
command_bind("load", NULL, (SIGNAL_FUNC) cmd_load);
}
void fe_modules_deinit(void)
{
command_unbind("load", (SIGNAL_FUNC) cmd_load);
}
#endif

Some files were not shown because too many files have changed in this diff Show more