1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-15 21:05:36 +00:00
Commit graph

49 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras
c2d2c33eae tests: build: Avoid linking against sip module
Fixes the deprecation warning from meson:

DEPRECATION: target sip links against shared module sip, which is incorrect.
             This will be an error in the future, so please use shared_library() for sip instead.
             If shared_module() was used for sip because it has references to undefined symbols,
             use shared_libary() with `override_options: ['b_lundef=false']` instead.
2022-03-02 09:16:12 +01:00
Evangelos Ribeiro Tzaras
fbbe17139d sip: origin: Add property tracking usage for tel URIs
Fixes #277
2021-12-26 17:45:12 +01:00
Evangelos Ribeiro Tzaras
876375a39b sip: provider: Skip creating credential directory on test
As it's not guaranteed that the home directory is always writable
during the build. Debspawn for example does not allow this
and we might get such a warning:

`CallsSipProvider-WARNING **: 21:58:14.839: Failed to create directory '/home/salsaci/.config/calls': 13`
2021-09-03 00:08:05 +02:00
Evangelos Ribeiro Tzaras
0bfa55473e sip: Make save_to_disk() public and use it when updating accounts
Account credentials will not get updated at all otherwise.
2021-09-02 09:12:13 +02:00
Evangelos Ribeiro Tzaras
c9dd476fa8 sip: Avoid dereferencing a NULL pointer
secret_password_*_finish() may return FALSE without setting the GError.
F.e. trying to remove a non existent secret is not a failure.

The bug supposedly manifests itself because the updating account credentials
from the UI does not always seem to work correctly.
2021-08-26 12:04:21 +00:00
Evangelos Ribeiro Tzaras
77ec258acc sip: provider: Try to create folder for credentials
Otherwise the user could be left unable to save credentials to disk later.

Fixes #326
2021-08-26 12:23:20 +02:00
Evangelos Ribeiro Tzaras
4e76efc5e7 sip: provider: No need to print warning when no credentials file found
The file could simply not (yet) exist.
2021-08-26 12:23:20 +02:00
Evangelos Ribeiro Tzaras
2520a9a555 sip: Avoid g_error for non-fatal issues
The media pipeline acting up does not warrant crashing the application.
2021-08-26 12:23:19 +02:00
Evangelos Ribeiro Tzaras
21578557f4 sip: provider: Don't store the password in the GKeyFile 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
fe6b5f9f4a sip: provider: Retrieve password from keyring
Fixes #251.
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
8ca63828df sip: provider: Delete password from keyring when deleting account 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
a8516f6e7b sip: provider: Update credentials on disk when removing origin
Otherwise the key file will be unaltered and loads the same account on
the next startup.

One more step closer to fixing #251.
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
40cea6760b sip: provider: Use the secret store to store credentials 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
3f12b3fcd5 sip: provider: Add argument to _add_origin() whether to store credentials
This allows us to avoid unnecessary saving to disk during initial account
loading.
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
5c1b76908b sip: provider: Save accounts to disk 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
7717633698 sip: provider: Add API to save credentials to GKeyFile 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
e36469e796 sip: Implement CallsAccountProvider interface 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
1749dcec60 sip: provider: Add API to remove origins 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
1a4b501653 sip: provider: Rename test environment variable 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
fd9b57c1b3 sip: provider: Load credentials from GKeyFile 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
58331afcf7 sip: provider: Use g_auto and GStrv
Instead of char** and g_strfreev()
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
babd013bd7 Remove CallsCredentials and adapt to changes
The provider knows best which credentials it needs and CallsCredentials
was not generic to begin with, so get rid of it.
2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
2af2b316ec Various codestyle fixes 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras
f930874d00 sip: provider: Keep provider alive while there are still origins
CallsSipOrigin accesses the CallsSipContext (owned by the provider) in its
dispose() which will be invalid once CallsSipProvider gets freed.
This commit will make certain that the provider stays alive for the lifetime
of it's origins.
2021-06-26 08:56:18 +02:00
Evangelos Ribeiro Tzaras
96a7d901c1 Fix old-style warnings all over the codebase
As caught by compiling with `-Wold-style-definition` and `-Wstrict-prototypes`.
2021-06-03 19:46:45 +00:00
Evangelos Ribeiro Tzaras
dde4bd8abf sip: provider: Don't warn when trying to add account multiple times
A g_debug() will suffice which will let us get rid of g_test_expect_message() to
as we don't need to guard against the warning anymore.
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras
7ad0f4cdd6 provider: Add API to query supported protocols
These are the protocols that the provider plugin may support. The origins
must be queried independently whether or not they support any given protocol.

Example: A SIP origin/account may or may not support the "tel" protocol.
2021-05-28 17:02:02 +02:00
Evangelos Ribeiro Tzaras
1def4c3585 plugins: provider: Use CallsOrigin instead of derived types for GListStore
Otherwise we run into trouble when using `g_list_store_find()`
2021-05-28 13:18:24 +02:00
Evangelos Ribeiro Tzaras
95f16cb527 sip: provider: Implement CallsAccountProvider interface 2021-05-04 06:44:43 +02:00
Evangelos Ribeiro Tzaras
36cd9bd122 sip: provider: return origin in calls_sip_provider_add_origin() 2021-05-04 05:58:41 +02:00
Evangelos Ribeiro Tzaras
5d0de3d299 sip: origin: Use CallsCredentials and adapt to changes
All parts not related to credentials are now being set when creating the nua
handles and then updated with nua_set_params() when the credentials get updated.
2021-05-04 05:57:06 +02:00
Evangelos Ribeiro Tzaras
3f72d34c49 Add CallsCredentials class and use it in CallsSipProvider
CallsCredentials is a dumb container to store account credentials.
This is done in preparation for the account management in the UI.
2021-05-04 05:57:06 +02:00
Evangelos Ribeiro Tzaras
70cb120951 sip: fix typos
Thanks to lintian for pointing it out!
2021-04-23 15:35:14 +02:00
Evangelos Ribeiro Tzaras
f178b3546b sip: provider: document public functions 2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
7ed1ee2502 sip: codestyle changes
Shuffle the code around and make use of docstrings to conform to
the newly introduced coding style as described in `HACKING.md`

This commit also introduces docstrings describing each source file.
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
166ea8b21a sip: origin: Allow using a local port of 0
Using a port of 0 let's the operating system decide to which port to bind to.
Additionally refuse to use priviliged ports and print a warning.
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
f7626e532f sip: provider: use g_clear_pointer pattern instead of emulating it 2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
6e6873432b sip: provider: Allow overriding SIP account config via environment
This will make it easier for testing down the line.
2021-04-16 00:39:42 +00:00
Evangelos Ribeiro Tzaras
a44c265903 sip: remove FOR_TESTING ifdef 2021-04-06 16:55:33 +00:00
Evangelos Ribeiro Tzaras
75d32d0924 sip: Allow controlling automatic account loading via environment 2021-04-05 06:13:44 +00:00
Evangelos Ribeiro Tzaras
71cbc5c636 sip: provider: Fall back to reasonable values for local-port property 2021-04-03 00:46:29 +02:00
Evangelos Ribeiro Tzaras
5a7c22c80f sip: provider: use g_get_user_config_dir () for account config 2021-04-03 00:46:29 +02:00
Evangelos Ribeiro Tzaras
840ffa4653 sip: do not auto load accounts when running tests
because `calls_sip_provider_load_accounts ()` looks at the home folder
for a configuration file.
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
cadaa6a3e0 sip: use g_return_if_fail and friends only for public functions 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
1836c7c915 sip: allow specifying local port and use IPv6 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
4521033127 sip: origin: register with SIP server 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
2dfa42d48d sip: sipify provider with sofia 2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
7971fb5afb sip: Origin needs account credentials
Credentials can be set through a config file. The config file is parsed
by CallsSipProvider in order to add origins for each SIP account.
2021-04-03 00:08:31 +02:00
Evangelos Ribeiro Tzaras
71e7a33626 sip: Initial provider
based on dummy provider
2021-04-03 00:08:31 +02:00