Fork 0
Commit Graph

938 Commits

Author SHA1 Message Date
Michael Vetter 6b9d0e8647 Update accounts_find_all header in test stub
Fix https://bugs.gentoo.org/927179
2024-03-17 16:44:00 +01:00
Michael Vetter 88b26cfdb9 Undo gmainloop related changes
Revert "Merge pull request #1943 from H3rnand3zzz/gmainloop

This reverts commit 609fde0998, reversing
changes made to 2ec94064ed.

Revert "Merge pull request #1948 from H3rnand3zzz/fix/rl-less-refreshes"

This reverts commit 11762fd2b0, reversing
changes made to 609fde0998.

We have got several issues, that we don't quite see how to solve, with
the merge of the gmainloop PR.

* Slashguard is broken (#1955) (though #1956 could fix that)
* One person reported problems with copy paste selection via mouse
* Some input buffer seems not to be cleared correctly
  It happened that I was debugging profanity used `/connect` and typed
  the password. I then debugged so long that a time out occurred, so
  profanity disconnected. Then it printed "unknown command: $password".

There was something else that I forgot now.

Bottomline is: so far we didn't get it right so we will undo these
changes until someone proposes a working solution.

We got a slight performance increase (apparently noticable when
alt+mouse scrolling) but got too many issues with this change.
2024-02-19 17:41:06 +01:00
Michael Vetter 609fde0998
Merge pull request #1943 from H3rnand3zzz/gmainloop
Use Gmainloop as a main loop to increase performance
2024-01-16 12:18:34 +01:00
Steffen Jaeckel f458d6ebdf Fix when feature discovery is finished
Feature discovery was marked as finished once we received a reply to the
initial request. The discovery mechanism allows to delegate the real
feature discovery to another service running on different domain and those
requests are created dynamically.

This was another instance causing the warning message described in #1940

Fixes #1940 (once more)

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-12-28 19:21:27 +01:00
John Hernandez 080b0f825a
Add stubs for inputwin to fix autotests 2023-12-28 18:18:40 +01:00
Steffen Jaeckel b4c088232e Improve const correctness
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-12-12 18:27:09 +01:00
Steffen Jaeckel bac24601da Introduce `equals_our_barejid()`
Instead of always repeating the same pattern, introduce a helper function.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-12-12 18:27:02 +01:00
Steffen Jaeckel 847a86de50 add `connection_get_jid()`
Use a singleton `Jid` inside the connection instead of always re-creating
a `Jid` from the same string.

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-12-12 18:26:21 +01:00
John Hernandez 53db7562b5 Format `test_cmd_otr.c` 2023-11-11 10:04:38 +01:00
ike08 d35a7a7f7e Refactor tests to use the new cmocka test runner
## Summary

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

Update functional and unit test code to comply with the current cmocka test runner.  

## Changes

- `UnitTest` struct to `CMUnitTest` struct
- `unit_test()` macro to `cmocka_unit_test(f)` macro
- `unit_test_setup_teardown()` macro to `cmocka_unit_test_setup_teardown` macro
- `run_tests()` macro to `cmocka_run_group_tests()` function
- Setup and teardown functions return `int` instead of `void`

## Testing

### Unit Tests

`make check`

### Functional Tests

I did not compile or run functional tests because they are *shelved* for now.

### Valgrind

I'm not entirely sure how to fun Valgrind in this case. I did not do fancy memory management, so it should be fine.
2023-11-01 18:30:08 -06:00
Michael Vetter f7cce4c5c1 Move /os into /privacy os
Related to https://github.com/profanity-im/profanity/issues/1836
2023-07-25 16:35:14 +02:00
Michael Vetter feba4b8263 Add cons_privacy_setting() to print privacy setting infos 2023-07-24 18:25:34 +02:00
John Hernandez 8304ac86ff `g_free()` to `auto_gfree`, introduce `auto_guchar`
Fix 11 potential mem leaks in theme.c
2023-07-13 17:04:59 +02:00
John Hernandez e1d137f4e6 Change char->free to auto_char char for autocleanup
Replace `gchar` and `g_free` to `auto_gchar`
Correct certain  `char` functions/variables to `gchar`

Related to #1819.

Edited by @jubalh.
2023-07-11 13:26:37 +02:00
John Hernandez 4a70f5f513 Cleanup `char*` to `auto_gchar gchar*` for `prefs_get_string`
Necessity explained in #1819
2023-07-03 16:06:27 +02:00
Michael Vetter f67d548ebf
Merge pull request #1850 from H3rnand3zzz/feature/pgp-improved
Extend `/pgp` command to make key exchange procedure easier
2023-07-03 14:18:35 +02:00
John Hernandez 36784738fc Add optional pgp public key autoimport
Refactor `p_gpg_list_keys`
Add `/pgp autoimport` command,
it's not described in XEP-0027, but used in some clients,
such as PSI, Pidgin. It will autoimport keys received with
`/pgp sendpub`, in plain text as a message, or using features,
provided in other clients. It doesn't autoassign them, but shows
command to assign, letting user to decide.
Improve documentation for some preexisting functions
Add contact argument to `/pgp sendpub`
2023-07-02 14:25:55 +02:00
John Hernandez a59623a007 Add `/pgp sendpub` command
Command allows to share your PGP pub key with ease,
it's not described in XEP-0027, but used in some clients,
such as PSI, Pidgin.
Fix typos
Minor improvements
2023-07-02 14:25:55 +02:00
Michael Vetter 6247c28e31
Merge pull request #1842 from H3rnand3zzz/feature/plugins-download
New Feature: Plugins Download
2023-06-06 18:35:18 +02:00
John Hernandez 95e06ad169 Add url support (downloading) to `/plugins install`
Additional changes include code refactoring.
2023-05-16 15:57:07 +02:00
Michael Vetter ea35a4ceb0
Merge branch 'master' into cleanup/gchar-char 2023-05-11 08:45:46 +02:00
Steffen Jaeckel 8cd53acfd7 fix `/reconnect now`
This fixes #1846
Issue introduced by a0aa26b6fa

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-05-10 18:12:11 +02:00
John Hernandez 7f3fca2bd0 Cleanup: gchar as gchar instead of char
Use gchar instead of char in most of the cases where gchar is intended.

Reason: improve compatibility and stability. Issue #1819

Minor refactoring.
2023-05-04 16:15:09 +02:00
IsaacM88 ecdeb750f3 Add ability to disable avatar publishing
Add "/avatar disable" to comply with point "3.5 Publisher Disables
Avatar Publishing" in XEP-0084.

Add "disable" argument. Reword the "/avatar" command description
so it flows better.

Add "disable" to the "/avatar" autocomplete dictionary.

Split "/avatar" commands into two groups with an if statement; those
with a parameter and those without. "cons_bad_cmd_usage()" is in both
groups, which is messy. "disable" has similar logic to "set", but it
includes a failure message.

"avatar_publishing_disable()" uses the same logic to publish metadata
as in "avatar_set()".

Add a message to inform users when they do not receive an avatar after
using "/avatar get" and "/avatar open". In case of a failure, the user
will be subscribed to future avatar updates as long as they continue
to use their current instance of profanity. Adding
"caps_remove_feature()" after "cons_show()" will unsubscribe the user
from avatar updates and prevent the user from downloading an avatar
unexpectedly hours later without issuing an "/avatar" command.

The new "disable" function follows the same logic as
2023-05-02 14:45:54 -06:00
John Hernandez 07cc19ce10 Add sessions_alarm
Introduce new feature: sessions_alarm.

Added new account setting: max_connections. On exceeding this number,
user will get an alert. If number is less than 1, no alert will happen.

Tests altered to fit new feature.
2023-04-18 14:28:20 +02:00
John Hernandez 5b8b9074a2 Add nickname support for /roster remove
Add support of name/nickname instead of only JID for `/roster remove` command.

Add tests for it as well.
2023-04-13 16:41:21 +02:00
John Hernandez 5d3c8ce7c1 Allow setting client identification name/version manually
Add changes allowing user to switch client name and version.

Useful for enhancing user privacy.

Minor cleanup.
2023-04-09 14:17:01 +02:00
Michael Vetter a086cfbc78
Merge pull request #1808 from MarcoPolo-PasTonMolo/fix/empty_window_after_reconnect
Fix empty window after reconnect
2023-04-03 17:16:47 +02:00
Daniel Santos c7f05c9ebf Fix typos and update codespell configuration
* Fix typos.
 * Add words that are not typos to codespell's ignore words list and
 ignore regex.
 * Make codespell ignore URIs.
 * Make `make doublecheck` throw no error.

Signed-off-by: Daniel Santos <dacs.git@brilhante.top>
2023-04-03 13:25:25 +01:00
MarcoPolo-PasTonMolo ce688f6737 Fix empty window after reconnect
Sometimes after a reconnect the current window would get cleared. This
was a deliberate change to fix the profanity window looking all garbled
up after providing the passphrase for a gpg key using pinentry-curses.

Fixes https://github.com/profanity-im/profanity/issues/1556
2023-04-02 21:53:12 +03:00
Steffen Jaeckel 2925e85cd6 add test-case for #1761
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-03-11 15:05:03 +01:00
IsaacM88 d043d53948 Fix duplicate download IDs.
Fixes https://github.com/profanity-im/profanity/issues/1794

The problem is the download's identifier. Downloads are given an ID so they can be referenced later when their progress changes. Currently, the download's ID is the download's URL. When you download the same file twice, you have two downloads with the same ID. Download progress updates are shown on the first of both downloads with the same ID.

Change the download's ID from its URL to a random number. A random ID is generated when get_random_string() is called from cmd_funcs.c. Several other functions are updated to cope with the new ID format.
2023-03-09 15:02:26 -07:00
Steffen Jaeckel 302d0dd576 let `account_new()` take ownership of passed values
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Steffen Jaeckel a0aa26b6fa add `now` option to `/reconnect` command
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Steffen Jaeckel e9aaba938b minor changes
* fix typo
* less code duplication
* less `GString` usage
* more `auto_gchar` usage
* document connecting to servers supporting SASL ANONYMOUS
* ignore valgrind output

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 20:02:46 +01:00
Steffen Jaeckel b1b6c6f62d add `/strophe` command to modify libstrophe-specific settings
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2023-01-18 17:04:41 +01:00
Michael Vetter 3adc399da0 Update copyright year 2023-01-10 10:37:25 +01:00
Michael Vetter e5f506a200 Add MAM test stubs 2022-10-21 16:47:03 +02:00
Marouane L f934c5b59f
Add vCard support
Only nicknames, photos, birthdays, addresses, telephone numbers, emails,
JIDs, titles, roles, notes, and URLs are supported

Due to the synopsis array not having enough space, `/vcard photo
open-self` and `/vcard photo save-self` are not documented properly in
the synopsis section of the `/vcard` command, but they are documented in
the arguments section

Fixed memory leak in vcard autocomplete (thanks to debXwoody)
2022-10-18 23:24:30 +01:00
Michael Vetter a40a0f5189 Split ox functions from gpg.c to ox.c 2022-06-29 09:17:15 +02:00
Michael Vetter 87bf85c40b add chatlog unittest 2022-06-28 20:46:35 +02:00
Michael Vetter 918d060817 Display mood preferences 2022-06-22 11:45:13 +02:00
MarcoPolo-PasTonMolo e4e53d6e01 Don't forget encryption status for OX and PGP.
Use a pgp.enabled and ox.enabled array the same way that omemo.enabled
is used.

Fixes https://github.com/profanity-im/profanity/issues/1694
Fixes https://github.com/profanity-im/profanity/issues/733
2022-06-17 15:43:54 +03:00
Michael Vetter 2e85f18cd6 Use our omemo sid/fingerprint in qr code
Current clients sid/fingerprint will be shown in following format:

Fix https://github.com/profanity-im/profanity/issues/1320
2022-05-31 15:44:44 +02:00
Michael Vetter cf83976b51 Add basic qrcode functions 2022-05-30 18:04:36 +02:00
Michael Vetter d510f3a430 Final touches for `/avatar set` 2022-05-27 10:46:36 +02:00
MarcoPolo-PasTonMolo 0cff111249 Add checks for whether gdk-pixbuf exists before using avatar set 2022-05-26 21:06:27 +03:00
MarcoPolo-PasTonMolo 6a44e18853 Add `/avatar set` command to publish avatar
Use `/avatar set <path>` where <path> is an image file to upload a new
avatar for the current user. When the avatar is too big it gets scaled
down. Scaling code copied from dino.

Fixes https://github.com/profanity-im/profanity/issues/1687
2022-05-26 17:49:34 +03:00
Michael Vetter 1330ad4e1e Update copyright year 2022-05-09 15:43:33 +02:00
Michael Vetter b16bdca726 ox: show ox preferences 2022-05-05 23:55:31 +02:00