Commit Graph

7607 Commits

Author SHA1 Message Date
Michael Vetter
32ca4a2e30 build: add -Wno-unused-parameter 2026-02-05 13:02:17 +01:00
Michael Vetter
49ef85a58d build: introduce variable to check for xscreensaver
`.found()` does not work on lists. And since this feature needs
several deps it is a list.
2026-02-05 12:17:04 +01:00
Michael Vetter
87c4b7ec53 build: readd compiler flags that got lost in conversion 2026-02-05 12:16:42 +01:00
Michael Vetter
3f76676e9a build: use default meson buildtype
In autotools we had `package_status` which we set to either
`release` or `development`.
When converting from autotools to meson we used that mechanism
as well. But actually meson has a default way of handling this
with the option `buildtype`.

The following values are possible:
debug, debugoptimized, release, plain

So our `package_status = development` will now be
`if get_option('buildtype') == 'debug' or get_option('buildtype') ==
'debugoptimized'`. Probably we could also use
`if get_option('buildtype') == 'release'. But like this the
`plain` will be really plain.

Usage:
```
meson setup build --buildtype=debug
meson compile -C build
```
2026-02-05 12:16:34 +01:00
Michael Vetter
fbfa1f13e5 Add meson build system 2026-02-05 09:13:40 +01:00
Michael Vetter
f5ecceac91 Merge pull request #2066 from ritesh006/ci/cygwin-build
ci: add Cygwin build workflow
2026-01-24 20:09:18 +01:00
Ritesh Kudkelwar
f21ce24cd7 ci: add Cygwin build workflow
Add a GitHub Actions workflow to build with Cygwin on Windows.
Fixes issues by forcing Cygwin bash for all steps, handling temporary script paths,
stripping CRLF line endings, and enabling igncr.
2026-01-24 19:53:18 +05:30
Michael Vetter
fce4da4883 Merge pull request #2082 from balejk/sigterm
exit gracefully on SIGTERM and SIGHUP
2026-01-22 14:00:44 +01:00
Karel Balej
7c83c2608d exit gracefully on SIGTERM and SIGHUP
Make profanity exit gracefully when it receives either SIGTERM or
SIGHUP. This means that various cleanups will happen as if the user
issued the /quit command, whereas before these signals would terminate
profanity immediately leaving for instance the connection to the server
unterminated.

The main motivation for this change is so that profanity will exit
gracefully when the user closes the terminal that it's running in, which
is a handy shortcut (but can also happen on accident) and won't now lead
to the connection slowly timing out on the server instead. Similarly for
SIGTERM: profanity now for instance needs not be manually closed before
shutting down the computer to avoid the above as it will instead receive
this signal from the init process.
2026-01-22 13:37:56 +01:00
Michael Vetter
e8e9c29e4f Merge pull request #2075 from mcalierno/fix/apple-silicon-homebrew
Update compiler flags for homebrew packages on Apple silicon
2025-12-03 12:06:06 +01:00
Steffen Jaeckel
b17716570b Merge pull request #2080 from profanity-im/some-fixes
Some fixes
2025-11-26 22:07:03 +01:00
Steffen Jaeckel
01c781fcf6 Don't publish keys if the server doesn't support pubsub.
Related-to: https://github.com/profanity-im/profanity/issues/2078
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
1d508d592c Fix memory leaks when OMEMO keys have not been generated yet.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
fa1c4dddc9 Fix invalid free after /omemo gen
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
0830d82916 Minor fixes of accounts.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
f19acc2156 Fix reconnect when no account has been set up yet.
e.g. if one connects with an account for the first time and the server
returns a `see-other-host` error.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
c61c72f2f0 When renaming an account, copy all existing keys.
No need to have a fixed list of keys, we can simply copy all existing ones.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
bb964b2f1b Consistency please.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
7c04b17aff Simplify accounts_get_account().
* No need to call `g_key_file_has_key()` before calling a getter.
* Add helper to convert `gcharv` to `glist`.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
81f92f1fed Fix overwriting new accounts when running multiple instances.
If one is running multiple instances of profanity, the behavior of the
accounts module was to constantly overwrite the accounts file with the
version that was on-disk of the first instance of profanity started.

This is changed now in order to only write what we modified, we keep a
copy of the accounts file and when "saving" we re-read accounts from disk
and only update the values of the modified account.

This is not 100% fool proof if one modifies the same account from two
different instances, but still better than before.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
038f345a4e Minor improve theme
* Less `GString`.
* Don't `g_free()` a `strdup()`'ed string.
* Don't lookup the `console` window X times, but only once.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
54fea4afcf Minor improvements.
* Add new TLS policy `direct` as a replacement for `legacy`.
* Document that `/[command]?` prints the help of a command.
* Add option to get help via `/command help`.
* Fix `my-prof.supp` generation and tests for out-of-source builds.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
a50cd3a885 Refactor tlscerts.
* use `gchar` instead of `char`.
* improve situations when strings must be duplicated or can pass ownership.
* encapsulate the X.509 name details into a struct.
* prevent memory leaks if a name detail is contained multiple times.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
62fd40c510 Use gboolean consistently.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
b0221f6146 Simplify conf_string_list_{add,remove}() implementations.
* add can simply do a `memcpy()`.
* in remove we don't have to put the array in a list in order to put it
  back into an array again. Also we don't have to `strdup()` each entry,
  which leads to even less allocations.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
1ede01ed8c Free in reverse order.
... as much as possible ... subject and issuer details excluded.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:39 +01:00
Steffen Jaeckel
a07cff8a99 Use the stronger certificate fingerprint.
If a cert has a SHA256 use that one and only use SHA1 as fallback.

Closes: https://github.com/profanity-im/profanity/issues/2068
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:47:06 +01:00
Steffen Jaeckel
0acea8d0d2 Retrieve and save new fingerprints from libstrophe.
This also reads the certificate SHA256 and pubkey fingerprint from
libstrophe, but doesn't store it persistently yet.

Related-to: https://github.com/profanity-im/profanity/issues/2068
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:46:51 +01:00
Steffen Jaeckel
4dcaa839fa Prepare to use SHA256 fingerprints of certs.
First let's make clear we're currently using SHA1 & untangle the tlscerts
API from fingerprint specific details.

Related-to: https://github.com/profanity-im/profanity/issues/2068
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-23 12:46:29 +01:00
Steffen Jaeckel
7f5ae430af Fix more memleaks
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 12:16:29 +01:00
Steffen Jaeckel
24c3b5d531 Add new command /changes
With that command one can see the modifications of the runtime
configuration vs. the saved configuration.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 12:16:29 +01:00
Steffen Jaeckel
79ff9bad7d Fix OMEMO startup
When setting up OMEMO for the first time via `/omemo gen` one had
to reconnect in order to make OMEMO work. This is fixed now.

Fixes: 5b6b5130 ("Fix OMEMO keyfile loading")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 12:16:29 +01:00
Steffen Jaeckel
1aeb19acb0 Print PID in debug logs.
So one can easily see if there are two instances running, if they are
logging to the same file.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 12:16:29 +01:00
Steffen Jaeckel
2fb56b8536 Fix some more untyped APIs
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 12:16:29 +01:00
Steffen Jaeckel
48ac88de08 Fix GError handling
Several users have reported segfaults when starting up profanity which
has OMEMO support, but OMEMO is not set up yet.

@StefanKropp has been able to reproduce this and tracked it down to
`_load_identity()` calling `omemo_known_devices_keyfile_save()`.
The latter then calls `save_keyfile()` which calls
`g_key_file_save_to_file()`. This can then fail if one of the first two
strings is NULL and won't set the `error` on return. In its error handling
`save_keyfile()` unconditionally dereferences `error` which leads to the
segfault.

Fix this and also go through the entire codebase and verify that the usage
of `GError` is done correctly.

Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 12:16:29 +01:00
Steffen Jaeckel
5da079bbb2 Merge pull request #2072 from aryansri05/fix-otr-whitespace-detection
Fix OTR whitespace tag detection to prevent false positives
2025-11-03 22:15:58 +01:00
aryansri05
cff26a97af Fix OTR whitespace tag detection to prevent false positives
The previous implementation used strstr() which would match OTR tag patterns anywhere in the message. This caused normal messages containing these patterns to incorrectly trigger OTR session initialization.

Changed to use strncmp() to verify that V1/V2 tags immediately follow the base tag, ensuring only legitimate OTR whitespace tags trigger session establishment.

Fixes #1957
2025-11-03 22:02:14 +01:00
Michael
5ac6ab71a2 Use PKG_CHECK_MODULES to check for libgcrypt
On macOS running ./configure --enable-omemo was failing to find gcrypt despite being installed.
2025-10-26 11:49:32 +00:00
Michael
34e8b1b2f0 Update compiler flags for homebrew packages on Apple silicon
Add /opt/homebrew/{include,lib} flags for apple silicon macs, which are not included as default search paths by Clang/GCC. (Homebrew uses /usr/local/{include,lib} on intel macs)
2025-10-25 13:42:27 +01:00
Michael Vetter
58d130a0a9 ci: disable arch
```
 #11 0.137 --2025-09-18 10:41:06--  https://aur.archlinux.org/cgit/aur.git/snapshot/libstrophe-git.tar.gz
```

This currently blocks us at https://github.com/profanity-im/profanity/pull/2066.
2025-09-18 12:48:28 +02:00
Michael Vetter
6ce69428cb Merge pull request #2063 from jubalh/terminology-messages
docs: explain the different kinds of messages
2025-09-13 14:04:14 +02:00
Michael Vetter
2ac4e170a1 Merge pull request #2067 from mcalierno/bugfix/fix-mac-build
Add types to function prototypes
2025-09-13 13:50:38 +02:00
Michael
a704887f14 Add types to function prototypes
Build fail under macOS, Clang 16.0.0.
Add parameters to the following prototypes
- bookmark_ignore_on_connect()
- cons_show_qrcode()
2025-09-13 12:36:05 +01:00
Michael Vetter
58312ed0d8 Merge pull request #2062 from ritesh006/fix/cygwin-pthread
build: replace ACX_PTHREAD with AX_PTHREAD
2025-09-12 23:27:51 +02:00
ritesh006
26513840a8 build: replace ACX_PTHREAD with AX_PTHREAD
On Cygwin, ./configure failed with:

    ./configure: line XXXX: syntax error near unexpected token ACX_PTHREAD([], [AC_MSG_ERROR([pthread is required])])'

Root cause: ACX_PTHREAD is a legacy macro not provided by modern
Autoconf; the maintained macro is AX_PTHREAD (from autoconf-archive).

Changes:
- Replace ACX_PTHREAD with AX_PTHREAD in configure.ac.
- Rely on system autoconf-archive; do not vendor m4/ax_pthread.m4.
- Keep AC_CONFIG_MACRO_DIR([m4]) (harmless even if empty).

Result:
- autoreconf -fi && ./configure && make succeeds on Cygwin x86_64.
- Linux builds continue to work.

Fixes: #2059
2025-09-12 20:30:45 +05:30
Michael Vetter
000ef280dd docs: explain the different kinds of messages 2025-09-12 09:30:41 +02:00
Michael Vetter
44f9037e16 docs: fix typo 2025-09-05 11:47:59 +02:00
Michael Vetter
15a277eb9e Start new cycle 2025-08-22 09:31:58 +02:00
Michael Vetter
c01b531fe2 Release 0.15.1 2025-08-22 09:23:01 +02:00
Michael Vetter
66c7a6b7e4 Merge pull request #2060 from profanity-im/fix-1911
If config keyfile does not exist, create it.
2025-08-21 15:23:23 +02:00