merge: sync upstream profanity-im/profanity

Sync with upstream profanity-im/profanity.

Major upstream changes incorporated:

Memory management
  - Replace malloc+memset with g_new0 throughout codebase
  - Adopt auto_gchar / auto_gcharv / auto_gerror / auto_jid cleanup macros
  - Replace free() with g_free() for GAlloc'd memory

Editor rewrite
  - Remove pthread-based async editor; use GChildWatch callback API
  - New launch_editor(initial_content, callback, user_data) interface
  - Proper signal handling (SIGINT, SIGTSTP, SIGPIPE reset in child)
  - ui_suspend()/ui_resume() integration for TTY management

OMEMO improvements
  - Dual backend support: libsignal-protocol-c and libomemo-c
  - Proper pre-key removal after use (XEP-0384 compliance)
  - Automatic pre-key regeneration when store drops below threshold
  - New functions: omemo_is_device_active(), omemo_is_jid_trusted()
  - omemo_get_jid_untrusted_fingerprints() for better error messages
  - Fingerprint notifications on new device identity discovery
  - Deterministic pre-key ID generation tracking max_pre_key_id
  - omemo_trust_changed() UI updates on trust state changes

JID validation
  - RFC 6122-compliant validation in jid_is_valid()
  - Character-level checks (RFC 6122 forbidden chars: & ' / : < > @)
  - Length limits: 1023 per component, 3071 total
  - New jid_is_valid_user_jid() for user vs. service JID distinction

Database
  - Schema migration v3: UNIQUE constraint on archive_id for deduplication
  - Triggers for corrected message tracking (replaces_db_id / replaced_by_db_id)
  - db_history_result_t return type, _truncate_datetime_suffix()

UI / console
  - win_warn_needed() / win_warn_sent() warning deduplication hash table
  - PAD_MIN_HEIGHT dynamic pad sizing with PAD_THRESHOLD auto-cleanup
  - Spellcheck integration in input field with Unicode word detection
  - cons_spellcheck_setting() for /settings ui output
  - /[command]? shortcut for command help

Account config
  - Account name sanitization for GKeyFile special chars ([ ] = # \n \r)
  - Replace popen() with g_spawn_sync() for eval_password
  - TLS policy: add "direct" option alongside legacy

Connection
  - Port validation with g_assert (0–65535)
  - SHA-256 certificate fingerprint support (XMPP_CERT_PUBKEY_FINGERPRINT_SHA256)
  - "direct" TLS policy alias for legacy SSL

Common utilities
  - str_xml_sanitize() for XML 1.0 illegal character removal
  - string_matches_one_of() with formatted error messages
  - valid_tls_policy_option() helper
  - prof_date_time_format_iso8601() utility
  - Improved strip_arg_quotes() with backslash unescaping
  - prof_occurrences() uses g_slist_prepend + reverse for performance

PGP / OX
  - Proper GPGME resource cleanup with goto-cleanup pattern
  - g_string_free(xmppuri) leak fix in _ox_key_lookup

CSV export
  - Use GString + g_file_set_contents instead of raw write() syscalls

Tests
  - Restructured into subdirectories: command/, config/, xmpp/, ui/, omemo/, otr/, pgp/
  - New test_cmd_ac.c for autocompleter unit tests
  - Updated stubs for new UI suspend/resume functions

License headers
  - Migrate to SPDX-3.0 identifiers (GPL-3.0-or-later WITH OpenSSL-exception)

────────────────────────────────────────────────────
cproof-specific preservations:

  - XEP-0308 LMC: replace_id ?: id logic in message/stanza/omemo
  - Force encryption: cmd_force_encryption, test_forced_encryption
  - CWE-134: format string protection (cons_show("%s", ...))
  - y_start_pos-based paging in window.c
  - db_history_result_t return type, _truncate_datetime_suffix()

Merge-time fixes:

  - common.c: format-security (-Werror) — cons_show(errmsg) → cons_show("%s", errmsg)
  - database.c: null-deref guard — !msg->timestamp → msg && !msg->timestamp
  - console.c: implicit size_t → int cast — (int)(maxlen + 1)
  - tlscerts.c: %d for size_t — %zu

Build system:
  - Kept autotools (Makefile.am, configure.ac); upstream uses Meson
  - Restored deleted files: bootstrap.sh, autogen.sh, ax_valgrind_check.m4, configure-debug
  - Updated Makefile.am test paths for subdirectory structure
  - Added test_cmd_ac, test_forced_encryption to test sources

Functional tests:
  - Use cproof version; upstream requires stbbr_for_xmlns from updated stabber
  - Not yet available in devs/stabber fork

Closes #64

Merge author: jabber.developer2
Commits authors:
 Michael Vetter <jubalh@iodoru.org>
& Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
2026-05-26 17:48:14 +00:00
parent 3b673150b4
commit 72f4f186da
303 changed files with 10658 additions and 9857 deletions

269
CHANGELOG
View File

@@ -1,5 +1,5 @@
0.16.0 (unreleased)
===================
cproof fork (unreleased)
========================
Changes:
- Add flat-file database backend as alternative to SQLite for message history.
@@ -10,6 +10,271 @@ Changes:
- Add vtable-based database backend abstraction allowing pluggable storage.
- Add `make check-functional-flatfile` target to run functional tests with
flat-file backend.
- Add AI client with multi-provider chat support (OpenAI, local, etc.).
- Consolidate logging controls; show database backend in the statusbar.
0.17.0 (2026-03-26)
===================
Special thanks to our sponsor Matthew Fennell!
3 people contributed to this release: @botantony, @sjaeckel and @jubalh.
The last release (0.16.0) was the first that could be compiled with the Meson build system.
It provided a tarball for autotools and a separate one for meson. The autotools tarball was done
so that distributions don't need dependencies on automake, autoconf and libtool.
Several distributions are dropping vendor tarballs and use git checkouts or autogenerated tarballs nowadays.
Meaning they need to run the above mentioned tools in the case of the autotools build anyways.
So this release will only be shipped with tarballs generated with meson. Profanity can still be compiled with both autotools or meson for easier adjustments. Autotols users just need to generate configure first. The next release will only use Meson. So we encourage everybody to build with Meson arleady and report any bugs they encounter.
We finally re-enabled functional tests (along with our existing unit tests) again!
It would be appreciated if we could find people who want to help us expand the unit and functional tests so we are less likely to introduce regressions when we rewrite existing code.
Features:
- Add OMEMO trust status indicators to the titlebar (#2104)
- Add command autocompletion for /stamp (#2126)
- Add jid_is_valid_user_jid() to check for valid user JIDs (#2102)
- Add unified quality-check script and git hook support (#2099)
- Display incoming reports (XEP-0377) (#2117)
- Handle and allow JIDs with trailing slashes (#2102)
- Implement color coded status messages for file transfers (#2131)
- Implement dynamic pad resizing (#2122)
- Improve XEP-0377 support with report-origin and third-party elements (#2117)
- Improve feedback during OMEMO session Initiation (#2104)
- Improve validation of JIDs (#2102)
- Notify users when new OMEMO devices or fingerprints are discovered (#2104)
- Only request receipts when supported (#2101)
- Provide descriptive fallback messages for OMEMO decryption failures (#2104)
- Provide detailed encryption failure messages for OMEMO (#2104)
- Sanitize illegal XML characters from outgoing messages (#2116)
- Show active and trust status in /omemo fingerprint (#2104)
- Support UTF-8 characters in autocompletion (#2115)
- Suppress "new device" alerts for already known devices (#2113)
- Suppress redundant `session already exists` messages (#2113)
- Suppress repetitive missing device ID warnings (#2113)
- Introduce `prof_date_time_format_iso8601()`. (#2112)
- Optimize random data generation. (#2109)
Bug Fixes:
- Allow adding own JID to roster (#2127)
- Check for necessary pointers in omemo_receive_message
- Correct handling of create_fulljid without resource (#2102)
- Database return NULL if no history limits are found (#2102)
- Define `prefs_changes_print` outside of `prefs_changes` (#2090)
- Dont OMEMO trust check so often (#2108)
- Fix -Wanalyzer-deref-before-check warning in cmd_ac_complete (#2095)
- Fix Floating Point Exception in OMEMO session building (#2096)
- Fix NULL dereference and memory leak in _mam_rsm_id_handler (#2094)
- Fix NULL dereference and memory leaks in OX logic (#2094)
- Fix api_get_current_occupants() memory problems (#2094)
- Fix custom outgoing stamp and fix stamp command help (#2126)
- Fix file autocompletion bugs and restore cycling (#2100)
- Fix memory leak and potential crash in iq_id_handler_add (#2094)
- Fix not saving first created account (#2107)
- Fix rare memleak (#2123)
- Fix redundant error reporting in http download (#2094)
- Fix usage error in /time command (#2101)
- Handle potential NULL from malloc in OMEMO fingerprint decoding (#2094)
- Ignore self-presence for untracked MUC rooms (#2097)
- Improve status reporting and filename handling for /url save (#2131)
- Incorrect omemo decryption error for Key Transport Messages (#2130)
- Increase max arguments for /connect to 9 (#2101)
- Initialize OMEMO pointers and add NULL checks (#2094)
- Missing plugins_post_chat_message_display calls (#2118)
- Only allow /msg with valid JIDs (#2102)
- Sanitize account names (#2105)
- Segfault when using /command help (#2094)
- Use <body> tag for spam reporting (XEP-0377) (#2117)
- Fix -Wanalyzer-deref-before-check warning in get_message_from_editor (#2095)
- Fix potential double free. (#2112)
- Fix potential segfault. (#2109)
- Flush OMEMO store only after encrypting for all recipients. (#2109)
- Check connection state before accepting command. (#2124)
Documentation:
- Add Conventional Commit Structure
- Add a section explaining how to write functional tests (#2101)
- Add information about footers in git commit messages
- Add note about sanitizers overhead (#2101)
- Add section explaining how to run functional tests (#2101)
- Expand the build section in CONTRIBUTING.md (#2099)
- Explain how to turn clang-format of for some blocks of code (#2099)
- Explain how to write unit tests (#2099)
- Improve help for /blocked (#2117)
- Mention generated html pages in release guide
- Sort entries in theme_template
- Update implemented XEPs
- Update theme_template with missing options
Cleanup:
- Adapt loop counter to proper type (#2089)
- Adapt type and cast to get ride of warnings (#2089)
- Add a defensive check in cmd_process_input() (#2094)
- Be a bit more defensive in (#2094)
- Be a bit more defensive in server_events.c (#2094)
- Cast device ids in omemo.c (#2089)
- Cast g_hash_table_lookup return to function pointer (#2089)
- Cast to get rid of warnings (#2089)
- Check for strdup() success in stanza_create_http_upload_request() (#2094)
- Cleanup log module (#2094)
- Cleanup types (#2104)
- Correct comparison in cons_show_wins() (#2089)
- Fix cast function type warnings in pgp.c (#2089)
- Fix potential NULL dereference and leaks in cmd_sendfile (#2094)
- Fix potential NULL dereference in cmd_omemo_(un)trust (#2094)
- Fix potential null pointer dereference (#2094)
- Fix uninitialized field in color_distance() (#2089)
- Initialize GOptionEntry entries correctly (#2089)
- Initialize optional fields in profModule (#2089)
- Initialize waittime to 0 (#2094)
- Make _connection_handler() safer (#2094)
- Make muc_nick() return const char* (#2089)
- Map test files according to structure in src (#2099)
- Move loop var from int to size_t in cmd_funcs.c (#2089)
- Move loop var from int to size_t in omemo.c (#2089)
- Move more functions from int to guint in statusbar.c (#2089)
- Move some variables from int to guint in statusbar.c (#2089)
- Refactor account_eval_password to use glib (#2094)
- Use auto_FILE and handle fopen failure in command_docgen (#2094)
- Use g_malloc and auto_gchar in _win_print_wrapped (#2094)
- Use g_new() instead of malloc in prof_add_shutdown_routine() (#2094)
- Use g_new0 and g_strdup for alias allocation (#2094)
- Use g_new0 instead of malloc in buffer_get_entry_by_id() (#2094)
- Wrap release handler in iq.c (#2089)
- The buffer API should use `unsigned` types. (#2112)
Tests:
- Add prof_send_raw (#2115)
- Add test for get_expanded_path() (#2093)
- Add test for get_mentions() (#2093)
- Add test for release_is_new() (#2093)
- Add test for string_to_verbosity() (#2093)
- Add test for tab autocompletion of /msg (#2115)
- Add test for valid_tls_policy_option() (#2093)
- Add tests for string_matches_one_of() (#2093)
- Add tests for strtoi_range() (#2093)
- Apply coding style to unit tests (#2099)
- Check for binary before starting functional tests
- Don't build functional test with analyzer and increase timeouts (#2101)
- Fix functional presence tests (#2101)
- Fix functional test connect_shows_presence_updates (#2101)
- Fix functional test message_receive_chatwin (#2101)
- Fix functional test message_send (#2101)
- Fix functional test ping_jid (#2101)
- Fix functional test ping_responds_to_server_request (#2101)
- Fix functional test receive_carbon (#2101)
- Fix functional test resets_to_barejid_after_presence_received (#2101)
- Fix functional test rooms_query (#2101)
- Fix functional test send_receipt_on_request (#2101)
- Fix functional test sends_room_join (#2101)
- Fix functional test test_ping (#2101)
- Fix passing of special characters to prof_expect() (#2101)
- Improve autocomplete unit tests (#2093)
- Re-enable functional tests (#2101)
- Remove apparently unused code (#2101)
- Standardize naming convention (#2099)
- Try two places for profanity binary (#2101)
- Update unit tests (#2094)
Build System:
- Add --enable-functional-tests switch (#2123)
- Add -Wpointer-arith flag (#2095)
- Add -fstack-protector-strong compiler flag (#2094)
- Add .gitattributes to exclude development files from exports (#2123)
- Add support for libomemo-c as OMEMO backend (#2120)
- Enable -fanalyzer for static analysis (#2094)
- Enable _FORTIFY_SOURCE and -Og optimization (#2094)
- Enable more warnings in debug mode (#2089)
- Set -Qunused-arguments depending on compiler not os
Refactorings:
- Centralize validation within jid_is_valid (#2102)
- Change vcard_print() checks (#2094)
- Fix clang-format expansion of table (#2099)
- Improve key transport message handling and deduplicate errors (#2130)
- Make Jid use glib functions (#2094)
- Make Resource use glib functions (#2094)
- Make _writecsv safer and with better performance (#2094)
- Modernize cmd_ac_complete_filepath and simplify path handling (#2094)
- Move pgp module to gchar (#2094)
- Optimize prof_occurrences() (#2093)
- Partly move plugins to glib (#2094)
- Refactor OMEMO error handling and add non-null attributes (#2104)
- Refactor form_set_value to use glib list management (#2095)
- Replace calloc with g_new0 for struct allocations (#2094)
- Replace malloc with g_new0 in many occasions (#2094)
- Roster export uses GString and g_file_set_contents now (#2094)
- Start to standardize on gchar (#2094)
- Use g_malloc0 instead of calloc in get_random_string() (#2094)
- Use g_new in message_pubsub_event_handler_add() (#2094)
- Use p_contact_new instead of malloc in p_contact_new() (#2094)
Chores:
- Add 0.16.0 to release in doap file
- Add README explaining the purpose and usage of helper scripts (#2128)
- Add XEP comparison script
- Add changelog-helper script (#2128)
- Add copyright header to C files who had none
- Add linter file to be ignored upon export
- Make meson doublecheck only available if the script exists
- Move to SPDX license header
- Require DCO from now on (#2123)
- Unify build configuration script into one (#2128)
- Update clang-format action to 4.16.0
- Update valgrind suppression file (#2123)
- Use more descriptive names for helper scripts (#2128)
0.16.0 (2026-02-23)
===================
5 people contributed to this release: @balejk, @mcalierno, @ritesh006, @sjaeckel and @jubalh.
Thanks a lot to our sponsors: Matthew Fennell, Martin Dosch and one anonymous sponsor.
If you want to support us too: https://profanity-im.github.io/donate.html
This release depends on libstrophe >= 0.12.3.
Changes:
- Add new command /changes (#2080)
With that command one can see the modifications of the runtime
configuration vs. the saved configuration.
- Explain the different kinds of messages in the manpage (#2063)
- Fix OTR detection (#1957, #2072)
- Fix OMEMO startup (79ff9ba)
- Fix overwriting new accounts when running multiple instances (#2080)
- Fix reconnect when no account has been set up yet (#2080)
- Don't publish keys if the server doesn't support pubsub (#2078, #2080)
- Fix compilation on Apple silicon macs (#2075)
- Handle SIGTERM and SIGHUP (#2082)
- Cleanup (#2067, #2080)
- Add cygwin CI (#2066)
- Replace ACX_PTHREAD with AX_PTHREAD (#2062)
- Add meson build system (#2086)
Mainly for testing purposes. Details will be announced in a later release.
0.15.1 (2025-08-22)
===================
5 people contributed to this release: @andreasstieger, @killerdevildog, @mdosch,
@sjaeckel and @jubalh.
Thanks a lot to our sponsors: Matthew Fennell, Martin Dosch and one anonymous sponsor.
If you want to support us too: https://profanity-im.github.io/donate.html
This release depends on libstrophe >= 0.12.3.
Changes:
- Add `iso8601` as valid time format
`/time all set iso8601` instead of manual specification
- Fix ignoring of roster pushes (#2035)
- Print location of decrypted files (#2041)
- Fix GPGME >= 2.0.0 compatibility issue (#2048)
- Fix tests with gcc15 and uintptr_t (#2055)
- Reduce noise in log files (#1911, #2060)
- Cleanup, code improvement and memory fixes (#2033, #2041, #2053)
- Improve documentation (#2040, 18f157b, #2058)
0.15.0 (2025-03-27)
===================