Commit Graph

7841 Commits

Author SHA1 Message Date
Michael Vetter
e4bfda2f8a fix: Incorrect omemo decryption error for Key Transport Messages
Correctly handle OMEMO stanzas that contain a <header> but no <payload>.
These "Key Transport Messages" (heartbeats) are used by some clients
for session maintenance and establishing trust.

Ref: a2726b6a7 made the <payload> element mandatory in the parser.
Ref: 4d49c2b74 the bug became user-visible.

Fixes: https://github.com/profanity-im/profanity/issues/2129
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-22 17:41:57 +01:00
Michael Vetter
a85a33e397 chore: Add linter file to be ignored upon export 2026-03-21 01:10:48 +01:00
Michael Vetter
287b466e3c Merge pull request #2128 from profanity-im/tooling
Improve tooling for development and maintenance
2026-03-21 01:07:05 +01:00
Michael Vetter
a8c7850a97 chore: Unify build configuration script into one
Earlier ci/meson-build.sh and ci/ci-build.sh.
The latter we then renamed to the more descriptive build-configuration-matrix.sh.

Both scripts are doing the same thing but for different build systems.
So lets merge them together.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-21 01:05:16 +01:00
Michael Vetter
beef714a30 ci: Add linter to make sure all commits are DCO signed
Mentioned in the CONTRIBUTING.md as well.
Let's enforce it.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-21 01:05:16 +01:00
Michael Vetter
9407eb958d ci: Add linter to make sure we use Conventional Commits
This will make it easier for us to write Changelogs for example.
See https://www.conventionalcommits.org/en/v1.0.0.
Also mentioned in the CONTRIBUTING.md

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-21 01:05:11 +01:00
Michael Vetter
d808b88b55 chore: Add README explaining the purpose and usage of helper scripts
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-21 01:02:48 +01:00
Michael Vetter
a786ba3564 chore: Add changelog-helper script
Since we now use Conventional Commits we can create our Changelog
semi-automatically.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-21 01:02:36 +01:00
Michael Vetter
4347af833a chore: Use more descriptive names for helper scripts
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-21 00:18:52 +01:00
Michael Vetter
53a980cdd3 Merge pull request #2122 from profanity-im/fix-2045
feat(ui): implement dynamic pad resizing
2026-03-21 00:00:06 +01:00
Michael Vetter
98fc8b6110 Merge pull request #2127 from profanity-im/fix/2084
fix: allow adding own JID to roster
2026-03-20 23:59:04 +01:00
Michael Vetter
4c731f5241 fix: allow adding own JID to roster
Enable adding oneself to the roster.

Self subscriptions are implicit according to XEP-0060 / XEP-0163.
So we adapt the /sub command to handle this gracefully by just printing
an informative message.

Profanitys logic didn't handle own presence/when adding to roster
correctly. This got fixed now.

Fixes: https://github.com/profanity-im/profanity/issues/2084

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-20 23:48:00 +01:00
Michael Vetter
bbdd5e176a Merge pull request #2126 from profanity-im/fix/2125
fix(ui): Fix custom outgoing stamp and fix stamp command help
2026-03-20 22:15:33 +01:00
Michael Vetter
9035af95cb feat: Add command autocompletion for /stamp
Ref: 2c003dd2
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-20 16:23:46 +01:00
Michael Vetter
b0a89530f2 fix(ui): Fix custom outgoing stamp and fix stamp command help
Replace the hardcoded "me" stamp for outgoing messages that are
sometimes used with the value from PREF_OUTGOING_STAMP.

It was never implemented in all code paths. Like with receipts for
example.

Additionally fix the confusing description and variable names.

Ref: 2c003dd2 (Add /stamp feature)
Ref: 3a4cd7da (Broke the variables)
Fixes: https://github.com/profanity-im/profanity/issues/2125
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-20 16:23:41 +01:00
Michael Vetter
c3fbb89a7a Merge pull request #2123 from profanity-im/ci
ci: Cleanup and improve CI jobs
2026-03-20 15:09:31 +01:00
Michael Vetter
540d9e686c ci: Don't run functional tests in CI yet
Disable the functional tests in the case of meson as well.
They don't seem to work in the CI or take too long.
This needs further investigation. For now let's run them locally and
before each release.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-20 14:22:26 +01:00
Michael Vetter
c7834e022b chore: Require DCO from now on
Explain the how and why in CONTRIBUTING.md

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
2026-03-20 14:16:46 +01:00
Michael Vetter
3b988f6790 build: add .gitattributes to exclude development files from exports
This will result in smaller and cleaner tarballs for distributions to use.

Additionally it is a logical step towards moving fully to the Meson build system.
While the last release provided two tarballs (one generated with
Autotools and one with Meson), the next release will only provide a
Meson-generated tarball.

These attributes are respected by `git archive` and `meson dist` which
means they will take effect for the Meson generated tarballs and the
GitHub autogenerated tarballs as well.

As a consequence of switching to `meson dist`, pre-generated files like
`configure` will no longer be included in the tarballs. Users and
distributions that still wish to use the Autotools build system from
these tarballs will now need to run `./bootstrap.sh` or `autoreconf -fi`
themselves, which requires automake, autoconf, and libtool to be
installed.

Since many distributions are slowly dropping the usage of vendor
generated tarballs and are moving to checking out git tags this should
not be a problem.
Arch Linux is for example doing
`source=("git+https://github.com/user/project.git#tag=v1.2.3")` and
Debian has the `git-buildpackage` too. So both of them require require
autoreconf already.

Autotools support might be removed entirely in a future
release since I find them much easier to edit and maintain.
2026-03-20 14:03:52 +01:00
Michael Vetter
24335c657c ci: Sort jobs and names in a better way
Instead of:

```
CI / Check coding style
CI / Check spelling
CI / debian | Autotools | unit | signal
CI / debian | Meson | unit+func | libomemo
CI / debian | Meson | unit+func | signal
CI / fedora | Autotools | unit | signal
CI / ubuntu | Autotools | unit | signal
Cygwin / cygwin-build
```

We will sort them into "Style", "Linux" and "Cygwin".
2026-03-20 13:14:02 +01:00
Michael Vetter
551aea683a ci: Only print log file if we find it 2026-03-20 12:47:39 +01:00
Michael Vetter
2d7426fb2f fix: Fix rare memleak
Triggered by unit tests. In Profanity itself the situation is probably
rarely happening. We would have to disconnect/exit after receiving
presence but before the roster arrives.
2026-03-20 12:47:39 +01:00
Michael Vetter
4417ec453a chore: Update valgrind suppression file
Locally valgrind is quiet. But on CI valgrind complains. This is due to
an older valgrind version which doesn't handle AVX2-optimized strings
properly. So we need to add it to the suppression file.
2026-03-20 12:47:36 +01:00
Michael Vetter
3596e4c263 ci: Run functional tests only in the case of meson
Remove stabber from Dockerfiles were we only build with autotools.
2026-03-20 12:45:40 +01:00
Michael Vetter
f778e3e093 build(autotools): Add --enable-functional-tests switch 2026-03-20 12:45:40 +01:00
Michael Vetter
45ddbe94e8 ci: Make CI more informative
Have a better overview, we are interested in which tests are run, which
distro, which build system and which omemo backend.

debian | Autotools | unit+func | signal
debian | Meson | unit+func | signal
debian | Meson | unit+func | libomemo
fedora | Autotools | unit+func | signal
ubuntu | Autotools | unit+func | signal
2026-03-20 12:34:39 +01:00
Michael Vetter
9904c05841 Merge pull request #2124 from profanity-im/fix-2083
Check connection state before accepting command.
2026-03-20 10:44:32 +01:00
Steffen Jaeckel
613df86450 Check connection state before accepting command.
Prevent `/register` and `/reconnect` if connection is not in correct state.

Fixes: https://github.com/profanity-im/profanity/issues/2083
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-03-20 09:23:41 +01:00
Michael Vetter
8548dfca96 ci: Move CI related files into own directory 2026-03-20 08:36:17 +01:00
Michael Vetter
180ee651a5 ci: Remove OpenBSD
There once was OpenBSD CI from sr.ht sponsored by wstrm.
It's not available since a log time. So let's drop it.
2026-03-20 08:23:18 +01:00
Michael Vetter
b53ec23778 ci: Remove Brewfile
a4cbf3e4 removed macOS from the CI.
We couldn't get it to build and no community member stepped up.
So let's remove this file now as well.
2026-03-20 08:21:52 +01:00
Michael Vetter
3e16ae1def feat(ui): implement dynamic pad resizing
The ncurses pad used for rendering window history had a fixed height of 100
lines, which caused "Ncurses Overflow!" errors and broke scrolling once
the content exceeded this limit.

This commit replaces the fixed limit with a dynamic resizing strategy.
We use a minimum height of 100 lines.
If a pad reaches its threshold of 3000 lines, a full redraw is triggered
to reclaim space from discarded messages and reset the pad height.
Pads are shrunk back to the minimum height during every redraw to
minimize memory usage for inactive windows.

Message history should always be smoothly scrollable now.

d7e46d64fe set it from 1000 to 10000.
f27fa98717 set it from 1000 to 100.
Probably also relevant is 4fe2c423b1.

Close: https://github.com/profanity-im/profanity/pull/2074
Fixes: https://github.com/profanity-im/profanity/issues/2045
2026-03-19 22:10:36 +01:00
Michael Vetter
b219ce9e60 Merge pull request #2121 from profanity-im/ci-buildwithlibomemo
ci: Build with libomemo-c for the "Linux Meson" job
2026-03-19 20:24:33 +01:00
Michael Vetter
e252f54436 ci: Build with libomemo-c for the "Linux Meson" job
The rest will stay with libsignal-protocol-c. So we test both.
Let's add the dependency to all Dockerfiles already.
2026-03-19 20:11:26 +01:00
Michael Vetter
046eb13e2e Merge pull request #2117 from profanity-im/xep0377
Improve support for XEP-0377
2026-03-19 19:53:22 +01:00
Michael Vetter
456a266fa9 Merge pull request #2120 from profanity-im/feature/libomemo-support
Add support for libomemo-c as OMEMO backend
2026-03-19 19:52:35 +01:00
Michael Vetter
27b5f0fbda build(meson): add support for libomemo-c as OMEMO backend
Add the ability to choose between libsignal-protocol-c (default)
and libomemo-c when building with OMEMO support enabled in Meson.

Close: https://github.com/profanity-im/profanity/pull/2020
2026-03-19 19:01:50 +01:00
Michael Vetter
82db360fb9 feat: Improve XEP-0377 support with report-origin and third-party elements
Add support for <report-origin/> and <third-party/>.

When a server forwards a report to an administrator, the original reporter
(report-origin) and the offender (third-party) are preserved even
if the 'from' address is modified during forwarding.

Also display this information in case we receive a report.
2026-03-19 13:31:13 +01:00
Michael Vetter
d395cfb6b9 Merge pull request #2118 from profanity-im/fix-2011
fix: missing plugins_post_chat_message_display calls
2026-03-19 12:59:18 +01:00
Michael Vetter
1d94316937 fix: missing plugins_post_chat_message_display calls
We need the post-display hooks in DB, log, outgoing messages, and carbons as well.
Also add pre-display hook to carbons for consistency.

Fixes: https://github.com/profanity-im/profanity/issues/2011
2026-03-19 11:46:31 +01:00
Michael Vetter
030c0b7999 docs: Improve help for /blocked 2026-03-19 11:07:51 +01:00
Michael Vetter
93918a20d1 feat: Display incoming reports (XEP-0377)
Servers might forward incoming reports to admins. So we need to display
them so they can react upon it.
2026-03-19 10:57:41 +01:00
Michael Vetter
d616e160cd Merge pull request #2116 from profanity-im/sanitzexml
feat: Sanitize illegal XML characters from outgoing messages
2026-03-19 10:40:19 +01:00
Michael Vetter
446f28ac31 fix: Use <body> tag for spam reporting (XEP-0377)
Update `blocked_add` to use the `<body>` tag with the `jabber:client`
namespace when reporting spam, as specified in XEP-0377 Example 5.
Other report types continue to use the `<text>` tag.

Fixes: https://github.com/profanity-im/profanity/issues/1971
2026-03-19 10:36:59 +01:00
Michael Vetter
189050f3f4 feat: Sanitize illegal XML characters from outgoing messages
Filter out control characters (U+0000 to U+001F) from outgoing
messages, as they are illegal in XML 1.0 (except for \t, \n, and \r).
This prevents XMPP servers from closing the connection when such
characters are accidentally or intentionally included in a message.

Fixes: https://github.com/profanity-im/profanity/issues/1437
2026-03-19 10:28:49 +01:00
Michael Vetter
1f146d1499 Merge pull request #2113 from profanity-im/omemo-noise
Reduce OMEMO noise
2026-03-19 09:36:53 +01:00
Michael Vetter
6a569626fe Merge pull request #2115 from profanity-im/fix-1986
Properly support UTF-8 characters in autocompletion
2026-03-19 09:13:02 +01:00
Michael Vetter
f6b9903c31 tests: Add test for tab autocompletion of /msg
Test both latin and UTF-8.
2026-03-19 08:55:20 +01:00
Michael Vetter
ee0d325648 tests: add prof_send_raw
Allow sending byte sequences to the Profanity PTY without a newline.
Now we can simulate control characters, specifically the `TAB` key
(`\t`), to trigger autocompletion.
2026-03-19 08:50:58 +01:00
Michael Vetter
e9c6b3b3d8 feat(tools): support UTF-8 characters in autocompletion
Autocompletion failed for nicknames using non Latin scripts. We used
`g_str_to_ascii`, which replaces characters it cannot transliterate with
'?', leading search failures and false matches between different
scripts.

Now we do:
Use `g_utf8_casefold` for case-insensitive UTF-8 comparison. This
ensures that like 'Σ' correctly match 'σ' across all Unicode scripts,
providing correct results for non English nicknames.

If we don't fine anything typing a base ASCII character matches an
accented one (typing `e` matches `è`). This pass uses `g_str_to_ascii`
followed by `g_ascii_strdown` for comparison. It is now restricted to
run if the search string itself is valid ASCII, preventing the
"everything matches '?'" bug in non Latin scripts.

Autocomplete items are sorted using `strcmp`. `g_utf8_collate` provides
linguistical ordering for a specific language. But its behavior is
locale dependent and undefined when comparing strings from different
scripts. `strcmp` does byte-wise ordering that correctly follows Unicode
code order for UTF-8 strings.
2026-03-19 08:41:50 +01:00