1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00
Commit Graph

899 Commits

Author SHA1 Message Date
William Wennerström
f4ab1ca9e7
Move file encryption function to public header 2020-11-16 21:58:08 +01:00
William Wennerström
3370418d71
Initial /sendfile OMEMO encryption 2020-11-16 21:58:07 +01:00
Michael Vetter
90c4667e3b Remove non existent functions 2020-11-02 18:50:19 +01:00
Michael Vetter
693fdcce65 functest: Make char const 2020-10-15 10:12:33 +02:00
Michael Vetter
10d771f3d1 Merge branch 'master' of github.com:profanity-im/profanity 2020-07-10 13:46:06 +02:00
DebXWoody
0552e50c78 OX: XEP-0373: OpenPGP for XMPP - Version 0.5.0 (2020-06-19)
Discovering Public Keys via PEP

* 4.3 Discovering Public Keys of a User
* 4.4 Requesting Public Keys

* Import Public Keys into GnuPG's local keyring.

Issue: #1331
2020-07-10 13:40:00 +02:00
Michael Vetter
14a881697d Adapt unittests 2020-07-09 16:13:28 +02:00
Michael Vetter
a2726b6a7d Apply coding style 2020-07-07 14:18:57 +02:00
Michael Vetter
a4cadf78fa Revert "Apply coding style"
This reverts commit 9b55f2dec0.

Sorting the includes creates some problems.
2020-07-07 13:53:30 +02:00
Michael Vetter
9b55f2dec0 Apply coding style
Regards https://github.com/profanity-im/profanity/issues/1396
2020-07-07 09:43:28 +02:00
Michael Vetter
87ddb8081e Tests: Add ox_announce_public_key stub 2020-07-06 15:03:13 +02:00
Michael Vetter
e5ac12afa6 Remove prefs_free_string()
It just does a free.
Related to b580b9ef11
2020-07-02 11:34:12 +02:00
Michael Vetter
60f4098846 Add OX test stubs 2020-06-29 21:21:16 +02:00
Dmitry Podgorny
ac410445af Add option for legacy authentication
New options:
  /connect <account> [auth default|legacy]
  /account <account> set auth default|legacy

Fixes #1236.
2020-06-05 11:37:51 +03:00
Michael Vetter
12cafe4e60 Add include for waitpid to functionaltest 2020-06-04 12:02:02 +02:00
William Wennerström
05dde4bab4
Initialize ProfWin.urls_ac to NULL to fix OpenBSD build 2020-06-03 08:31:23 +02:00
Michael Vetter
ceb5dcc0e5 Fix clears_chat_sessions unittest 2020-05-28 16:09:32 +02:00
Michael Vetter
4b5711fad5 Add cons_show_bookmarks_ignore stub 2020-05-24 17:59:08 +02:00
Michael Vetter
70db2a4b63 Fix build on sr.ht
Hopefully fixing:
```
cc1: warnings being treated as errors
tests/unittests/test_cmd_otr.c: In function
'cmd_otr_start_sends_otr_query_message_to_current_recipeint':
tests/unittests/test_cmd_otr.c:422: warning: 'window.urls_ac' is used
uninitialized in this function
gmake[2]: *** [Makefile:1913: tests/unittests/test_cmd_otr.o] Error 1
gmake[2]: Leaving directory '/home/build/profanity'
gmake[1]: *** [Makefile:2442: check-am] Error 2
gmake[1]: Leaving directory '/home/build/profanity'
gmake: *** [Makefile:2445: check] Error 2
```
2020-05-22 14:41:42 +02:00
Michael Vetter
89fd9394aa Update bookmark test stub 2020-05-22 14:36:36 +02:00
Michael Vetter
889e19a5c5 Add executable stub 2020-05-20 14:17:05 +02:00
Michael Vetter
05db5226dd Fix http_upload stub 2020-04-17 10:44:39 +02:00
Michael Vetter
7419d29451 Update database stub 2020-04-07 11:31:17 +02:00
Michael Vetter
0942d98c61 Remove chat_log_get_previous()
We now dont get the log files from the text files via chat_log_get_previous() anymore.
We use the sql backend via log_database_get_previous_chat().

So far it just has the same behaviour like chat_log_get_previous(),
except that in _chatwin_history() we don't pass the sender to
win_print_history() which should be fixed in a commit soon.

And log_database_get_previous_chat() can later easily be expanded to fix
https://github.com/profanity-im/profanity/issues/205.
2020-04-06 14:42:52 +02:00
Michael Vetter
4cc8df5929 Add log_database_add_*() test stubs 2020-04-06 10:50:20 +02:00
Michael Vetter
6803fb5c3a Fix message_send_private unittest stub 2020-04-06 10:50:20 +02:00
Michael Vetter
062c7b1a89 db: add database unit test stub 2020-04-06 10:50:20 +02:00
Michael Vetter
3c56b289ed Add slashguard feature
New command `/slashguard` tries to protect against typing ` /quit` by
not allowing a slash in the first 4 characters.
2020-03-18 18:20:05 +01:00
Michael Vetter
0cc4ac5cbc Add cons_avatar_setting to unit test stub 2020-03-10 07:17:54 +01:00
Michael Vetter
f055faf31c Fix log test stub 2020-02-21 21:29:14 +01:00
Michael Vetter
4b1b035654 Fix test stub
Change done in eb2fbdba2e
2020-02-21 19:16:52 +01:00
Michael Vetter
1f8b1eb740 Allow utf8 symbols as omemo/pgp/otr indicator char
Fix https://github.com/profanity-im/profanity/issues/1264
2020-02-20 23:36:10 +01:00
Michael Vetter
8ee2cdadc8 Parse mentions and triggers in muc history if display is 'regular'
Fix https://github.com/profanity-im/profanity/issues/1261
2020-02-20 10:28:24 +01:00
William Wennerström
b267b065f5
Add builds.sr.ht CI for OpenBSD
* Add .builds/openbsd.yml for builds.sr.ht
* Update travis-build.sh -> ci-build.sh with OpenBSD case
* Fix libdl check in configure.ac (OpenBSD has libdl built-in)
* Fix some minor issues found when compiling on OpenBSD with GCC (e.g.
  uninitialized variables)
2020-02-17 10:54:15 +01:00
Michael Vetter
ca3afa7e05 test: Init window.layout to make compiler happy
Fix tests/unittests/test_cmd_otr.c:415: warning: 'window.layout' is used
uninitialized in this function on openbsd (thanks optmzr)
2020-02-14 14:40:20 +01:00
Michael Vetter
c614cc288a Fix tests 2020-02-14 10:17:07 +01:00
Michael Vetter
fb68d44264 xep-0308: adapt unit test stubs 2020-02-14 10:17:07 +01:00
Michael Vetter
83b61e5160 xep-0308: add cons_correction_setting stub to tests 2020-02-10 14:59:10 +01:00
Paul Fariello
137dc15bc8 Fix unittest build 2020-01-31 10:25:45 +01:00
Paul Fariello
a52e3ea1d8 Add context to autocomplete_with_func and use it for omemo trust command
Fix #1068
2020-01-31 10:07:08 +01:00
Michael Vetter
663aa09cce Add cons_os_setting stub for tests 2020-01-24 21:26:40 +01:00
Paul Fariello
84506cbaeb Use OMEMO for offline MUC members (#1242) 2020-01-20 14:28:13 +01:00
Michael Vetter
9ac72980d1 xep-0084: add test stub file 2019-12-18 15:44:59 +01:00
Michael Vetter
136f504d5e test: add cons_color_setting 2019-12-09 16:18:51 +01:00
Michael Vetter
750355acc4 Add cons_logging_setting() to test stub 2019-11-13 09:36:29 +01:00
Michael Vetter
b9734c8496 Add cons_titlebar_setting stub
and remove encwarn one.
2019-11-05 22:10:51 +01:00
Michael Vetter
f71de61b9d Don't override ProfMessage Id with origin-id
Profanity sends the same value for both. Other clients might not.
Safe both since we could need them later.

Once we implement Last Message Correction we will need the regular id.
If we override it with origin-id and another client chooses to not use
the same value for id and origin-id then we can't interpret the id sent
with the LMC request correctly.
2019-10-31 13:45:44 +01:00
Michael Vetter
6bfdc5422c Adjust message stubs in unit tests 2019-10-29 11:55:27 +01:00
Michael Vetter
8764e59650 Adjust stub for connection_get_profanity_identifier 2019-10-22 14:24:07 +02:00
Michael Vetter
c3912df05b Move ProfMessage and message_is_sent_by_us to xmpp
Not meant for internal usage only.
2019-10-19 06:36:47 +02:00
Michael Vetter
72bdae1014 Add message_is_sent_by_us stub 2019-10-18 14:53:06 +02:00
Michael Vetter
3bd5c9f535 Remove accidentally added file 2019-10-18 12:24:34 +02:00
Michael Vetter
5c6f5ba0f7 Add connection_get_profanity_identifier stub
And move defintion to xmpp.h
2019-10-18 11:23:30 +02:00
Dmitry Podgorny
0499c4e0ee Fix memory leak in unittests 2019-10-14 00:23:02 +03:00
Michael Vetter
8e5dafdea5 Fix invalid reads in unit tests 2019-10-10 19:02:23 +02:00
Michael Vetter
2559ad5370 Revert "Free lits in test_cmd_roster unittest"
This reverts commit 5b19ed28ce.

This caused a segfault.
2019-10-10 18:08:24 +02:00
Michael Vetter
a10ab4e692 First destroy roster then free list in test_cmd_roster 2019-10-06 19:13:45 +02:00
Michael Vetter
98676613fd Free strings in test_cmd_alias
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:45:53 +02:00
Michael Vetter
5b19ed28ce Free lits in test_cmd_roster unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:43:27 +02:00
Michael Vetter
1d23d6461d Remove not needed strdupin test_cmd_rooms
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:40:51 +02:00
Michael Vetter
5349b60385 Free autocomplete_complete results in unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:34:28 +02:00
Michael Vetter
2526e396f8 Fix autocomplete memleak in test_autocomplete
autocomplete_free() calls autocomplete_clear() and then frees the struct
itself.

Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:26:34 +02:00
Michael Vetter
700f97d78c Free lists in test_roster_list
Fix memleaks.
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 18:06:30 +02:00
Michael Vetter
9e6bc99d08 Fix two memleaks in test_parser
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:59:46 +02:00
Michael Vetter
1fabb61b40 Fix memleak in cmd_bookmark_list_shows_bookmarks unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:54:40 +02:00
Michael Vetter
6776e39644 Fix memleak in test_parser unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:50:29 +02:00
Michael Vetter
d2a087145c Fix memleak in test_callbacks unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:47:13 +02:00
Michael Vetter
4f11140bb5 Fix memleak in test_parser unittest
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:43:10 +02:00
Michael Vetter
81b537b36d Fix test_callbacks memleak
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:15:06 +02:00
Michael Vetter
ae9ef75bab Fix test_jid unittest memleak
Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-06 17:07:00 +02:00
Michael Vetter
fd18230cd4 Fix unittest memleak in test_cmd_join
muc_init() call without muc_close()

Regards https://github.com/profanity-im/profanity/issues/1019
2019-10-05 23:38:10 +02:00
Michael Vetter
10ca3e8c31 Possibility to specify alternative config file
Introduce `profanity -c` to specify an alternative config file.
2019-08-02 15:55:47 +02:00
Michael Vetter
88552da2d4 Add omemo_close stub for tests 2019-07-18 08:02:52 +02:00
Paul Fariello
ecf00af05b Add missing stub file 2019-07-17 16:02:12 +02:00
Paul Fariello
db8f32c049 Fix handling of encrypted carbons 2019-06-21 15:52:24 +02:00
Paul Fariello
f831f65737 Rename prof_message_t into ProfMessage 2019-06-20 14:30:45 +02:00
Paul Fariello
44d16e9141 Add prof_message_t to wrap all message attributes
Probably missing copy of body to plain in carbon and privmessage.
Only covers the incoming message path because goal is OMEMO decryption
of untrusted message.
Cover some of the log functions but not all.
2019-06-20 14:30:42 +02:00
Michael Vetter
6c9631d7ea Fix prefs_get_str related leaks in unit tests
Related to https://github.com/profanity-im/profanity/issues/1019
2019-06-19 17:15:47 +02:00
Michael Vetter
de787a8582 Remove cons_mouse_setting() stub
Mouse support has been disabled long ago.
2019-06-17 13:30:56 +02:00
Dmitry Podgorny
6138a5f79b Cancel autoping timer on disconnect or connection loss
If Profanity is disconnected in any way before ping response is
received, the autoping timer will expire after the next connection
is established. As result, user will be disconnected immediately.

Cancel autoping timer in ev_disconnect_cleanup(), so it is done
for all kind of disconnections.
2019-06-03 13:28:00 +03:00
Frank Zschockelt
4683395aca Use mock_type() for casting mock() 2019-05-08 21:52:16 +02:00
Frank Zschockelt
a5db791dc4 Use mock_ptr_type() to silence compiler warnings
Unit tests on 32-bit architectures were failing due to
"cast to pointer from integer of different size" warnings.
mock_ptr_type silences those by first casting to uintptr_t.
2019-05-08 21:51:29 +02:00
Michael Vetter
a28f0d9e74 Update tests with new URL
https://github.com/profanity-im/profanity/issues/1085
2019-05-03 10:46:41 +02:00
Michael Vetter
0d8a39d8dd Add occupantswin_occupants_all() stub to unittest 2019-04-23 14:47:42 +02:00
Paul Fariello
6d39f49f57 Fix server_event unit tests
roster_update_presence now requires that
roster_process_pending_presence() has been called. Otherwise presence
are set to pending and not processed yet.
2019-04-17 14:19:31 +02:00
Paul Fariello
3ef9123ccb Fix OTR unit test after account_new API change 2019-04-17 14:03:14 +02:00
Paul Fariello
7df7e05639 Fix unit test after account_new API change 2019-04-17 14:03:14 +02:00
Michael Vetter
b40fcf248c Add omemo_start_sessions to unittest stub 2019-04-14 00:02:17 +02:00
Paul Fariello
0bc660400b Automatically starts OMEMO if one identity is trusted 2019-04-10 17:24:56 +02:00
Paul Fariello
4ad6904216 Wait for discovery end to publish omemo devicelist and bundle
Add sv_ev_connection_features_received for that purpose
2019-04-10 17:23:46 +02:00
Paul Fariello
e69f947547 Rework MUC reflected message filtering
Reflected messages can't be filtered by nick only otherwise you might
ignore messages comming from you on another devices.

Consequently we maintain a list of sent messages id in mucwin.
To be sure the id will be correctly reflected we use the origin-id
stanza.
2019-04-10 17:23:46 +02:00
Paul Fariello
e7be3a605b Add OMEMO in prefs command 2019-04-10 17:23:46 +02:00
Paul Fariello
daf84ced0c Add required OMEMO stub for unit-test 2019-04-10 17:23:45 +02:00
Philip Flohr
5b7f9dffbc Fix broken support for case-sensitive account names
Don't lower account name before calling accounts_get_account().
Only lower if there is no account with the given name and the name is
interpreted as a jid.
Updated unittests to test this behaviour.

Fixes #725

.
2019-02-22 13:08:08 +01:00
Michael Vetter
706af9a900 Update copyright to include 2019 2019-01-22 11:31:45 +01:00
Dmitry Podgorny
e3f2ca7d10 tests: remove cflag -w and fix warnings
The flag hides errors. But we want unit tests to be correct in order
to reveal errors in the main code.

The patch removes tests_unittests_unittests_CFLAGS which makes autotools
use AM_CFLAGS instead. Therefore, unit tests are built with flags
derived from configure.ac.
2018-10-31 18:35:59 +02:00
Michael Vetter
47f90d7a39
Merge pull request #991 from paulfariello/feature/xep-0050
Add support for xep 0050 ad-hoc commands, without multi-step
2018-09-27 17:27:37 +02:00
Michael Vetter
82f8083b85 Move p_sha1_hash() to stanza.c
Move `p_sha1_hash()` from `common.c` to	`xmpp/stanza.c` as it is only
used in this file and now depends on libstrophe so xmpp is a better
namespace folder.
Renaming it as `_stanza_create_sha1_hash()`. And making static since
only used here.

The function cannot be tested in the unit tests anymore.
Once functional tests are working again we should write a test for the
sha1 functionality.
2018-09-06 20:40:09 +02:00
Paul Fariello
f0f973fcb4 Remove unused stup session_get_domain 2018-09-05 15:34:22 +02:00
Paul Fariello
e9e5f382da Add connection_get_domain stub for tests 2018-09-05 15:13:20 +02:00