1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-07-02 15:09:31 +00:00
Commit graph

815 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras ba77fb8de4 origin: Remove unused include 2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras 575569398b provider: Remove unused include 2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras ee56c8e87c new-call-box: Add explicit include
util.h is included transitively, but explicit is better than implicit.
2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras 94e940d5ff dbus-manager: Add explicit include
util.h is included transitively, but explicit is better than implicit.
2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras 5890aae5f8 manager: Add explicit include
util.h is included transitively, but explicit is better than implicit.
2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras 6bcc95c691 notifier: Add explicit include
util.h is included transitively, but explicit is better than implicit.
2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras c0cfaeaffe contacts-row: Use g_autoptr
folks 0.14 (shipped in Debian Bullseye) has cleanup functions defined.
2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras 9b49b0bc4f contacts-provider: Use STR_IS_NULL_OR_EMPTY macro 2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras b799605d01 contacts-provider: Codestyle 2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras ac83323de6 ui-call-data: Always use calls_best_match_get_avatar() to retrieve avatars
self->best_match is never NULL:
The test suite used to wrap calls_contacts_provder_new() to always return
NULL which in turn caused the best match to be NULL.

This was done to avoid warnings raised by libfolks
about missing the primary store (eds).

This is no longer necessary as the environment now tells folks which
backend to use.
2023-01-20 17:12:02 +01:00
Evangelos Ribeiro Tzaras 28f0ee42ee ui-call-data: Assert best_match is set
self->best_match is never NULL:
The test suite used to wrap calls_contacts_provder_new() to always return
NULL which in turn caused the best match to be NULL.

This was done to avoid warnings raised by libfolks
about missing the primary store (eds).

This is no longer necessary as the environment now tells folks which
backend to use.
2023-01-20 17:12:02 +01:00
Evangelos Ribeiro Tzaras 60ece1a656 ui-call-data: Use the name of the best match if individual was found
self->best_match is never NULL:
The test suite used to wrap calls_contacts_provder_new() to always return
NULL which in turn caused the best match to be NULL.

This was done to avoid warnings raised by libfolks
about missing the primary store (eds).

This is no longer necessary as the environment now tells folks which
backend to use.
2023-01-20 17:12:01 +01:00
Evangelos Ribeiro Tzaras e878fabb27 application: Remove and destroy application windows on shutdown
The windows need to be removed from the GtkApplication because they are
holding references to the application which prevents proper cleanup.

Fixes: #508
2023-01-11 18:50:22 +01:00
Evangelos Ribeiro Tzaras 177199467f application: Set unix signal handler source ID to 0
g_clear_signal_handle_id() will complain about unknown sources otherwise.
2023-01-11 18:47:43 +01:00
Evangelos Ribeiro Tzaras 56891363cb history-box: Fix clearing signal handler
By the time g_clear_signal_handler() was invoked self->model had already
been NULL'ed, so clear the signal before clearing the model.
2023-01-11 18:14:36 +01:00
Abderrahim Kitouni 14c630ab2e Only define EPhoneNumber autocleanup for old versions
This fixes build with latest evolution-data-server
2023-01-11 09:39:45 +00:00
Evangelos Ribeiro Tzaras 0d072e7335 ringer: Remove explicit DBus timeout handling
As libfeedback uses GDbusProxy under the hood which defaults to timing
out after 25 seconds there is no need to handle timeouts explicitly.

Furthermore 1 second seems to not always be enough time to get a
response which leads to endless ringing.

Fixes #543
2023-01-09 16:58:33 +00:00
Evangelos Ribeiro Tzaras a52a2a39f8 record-row: Defer enabling popup actions until displaying
There is no need to enable or disable actions until the popover
is actually presented.

This also get's rid of having to be notified of changes to the
"can-add-contact" property which led to a segfault as the signal handler
was not properly cleared.

Fixes: #535

As the "can-add-contact" property is now always checked,
the menu item will be properly shown.

Fixes: #485
2022-12-31 18:37:08 +01:00
Evangelos Ribeiro Tzaras f997048a38 build: Rename config.h to calls-config.h
This guards against accidentally including configuration from elsewhere.
2022-12-22 15:08:18 +00:00
Дилян Палаузов d363583802 ringer: Fix typo 2022-12-20 07:34:39 +01:00
Evangelos Ribeiro Tzaras 21ece5dc5f log: Use feature test macro before any include
_GNU_SOURCE is needed for strcasestr().

The macro should be defined before including any headers. This broke
recently because glib.h seems to include string.h now.
2022-12-03 19:46:25 +01:00
Evangelos Ribeiro Tzaras 3225be22a3 application: Print positive delta when changing verbosity
Since we already take into account if it's increasing or decreasing
we should make the amount (Increased/Decreased by N) positive.
2022-12-03 19:46:25 +01:00
Evangelos Ribeiro Tzaras 707eee51cb log: Fix returned verbosity delta
When we increase verbosity we want values > 0 returned.
2022-12-03 19:46:25 +01:00
Julian Sparber 486846b069 manager: Only set search path from CALLS_PLUGIN_DIR when path exists
Libpeas has issues searching in a path that doesn't exsist.
2022-12-03 12:32:29 +01:00
Julian Sparber d804b996f4 plugins: Rescan for plugins after adding search paths
Using rescan allows use to give a priority to search paths. So this way
plugins in `CALLS_PLUGIN_DIR` take precedence over plugins we ship.

This also makes sure that the plugin test searches in the same location
as CallsManager.
2022-12-03 12:32:29 +01:00
Evangelos Ribeiro Tzaras 0ead013d4d account-overview: Set window title
Set window title for the overview as well for adding or editing an account.
2022-11-18 13:49:47 +00:00
Evangelos Ribeiro Tzaras 7135d02e3e account-overview: Close windows when pressing Escape
Closes: #511
2022-11-18 13:49:47 +00:00
Evangelos Ribeiro Tzaras 19f8ac390b application: Shut down graceful on SIGTERM/SIGINT
This will allow cleaning up after ourselves, e.g. closing the record DB.

Fixes: #508
2022-11-17 10:00:03 +01:00
Evangelos Ribeiro Tzaras e1f0b83d25 ringer: Break loop if triggered event was ended immediately
When the only feedback of an event is unavailable on a system (e.g. no
vibration motor or LED) the "feedback-ended" signal is emitted
immediately and the end reason will be LFB_EVENT_END_REASON_NOT_FOUND.

In this case we need to change the target state, so that our logic does
not end up retriggering the event infinitely.
2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras e52f327aae ringer: Cancel async libfeedback calls on timeout
If libfeedback has not finished triggering/ending a feedback after one
second we give up and set an error state.
2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras 1056cba62a ringer: Never cancel async DBus calls and refactor
Previously our code assumed that g_cancellable_cancel() the async DBus
calls to libfeedback would guarantee that the underlying operation would
not be performed (i.e. triggering or ending a feedback).

However the endless ringing exhibited in #470 shows this assumption not
to hold. Therefore we avoid using g_cancellable_cancel () completely and
default to waiting for the async operation to finish.

update_ring () now sets the target state by inspecting managed calls and
the main logic will now step towards the target state:
Changing from regular/loud to soft/quiet ringing (or vice versa)
requires we first end feedback before (re)triggering it.

Additionally the "is-quiet" and "is-ringing" properties are replaced by
a new "state" property to allow changing the combination atomically.

Closes: #470
2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras 79401f6227 contact-provider: Allow can-add-contacts to be reset
Under normal conditions it is not expected that whether we can add
contacts or not (based on the presence of the appropriate action on
gnome-contacts) changes.

Nevertheless it can be beneficial for debugging when installing patched
and unpatched versions of gnome-contacts.
2022-11-08 11:28:18 +00:00
Evangelos Ribeiro Tzaras b948629274 contacts-provider: Remove unused variable 2022-11-08 11:28:18 +00:00
Evangelos Ribeiro Tzaras 352a7852f6 ui-call-data: Prevent timer being started multiple times
Fixes #502
2022-11-05 23:51:19 +00:00
Evangelos Ribeiro Tzaras 9b0b1741cc ui-call-data: Add debugging for state changes
This should help fixing issues like #502 in the future.
2022-11-05 23:51:19 +00:00
Evangelos Ribeiro Tzaras 1deee0b71b util: Add API to check address family of IP address 2022-11-01 11:04:35 +00:00
Evangelos Ribeiro Tzaras 29a2059e0e util: Rename function to calls_find_in_model() and adjust documentation
Since it works for GListModel rename it appropriately.

It used to provide an inline implementation for g_list_store_find()
behind a glib version guard, but we bumped minimum version in
cfd3c2a7fe
so the docstring was updated and made more succinct.
2022-11-01 11:04:35 +00:00
Evangelos Ribeiro Tzaras 0bcf3fa08e util: Remove unused code 2022-11-01 11:04:35 +00:00
Evangelos Ribeiro Tzaras f7e632dcb4 application: Propagate verbosity to main instance
If another instance of calls was already running, invoking calls with
`-v` flag would set the verbosity for the newly created process and then
exit if it was not the primary instance.
2022-11-01 10:19:08 +00:00
Evangelos Ribeiro Tzaras a5eb750350 log: Use unsigned int for verbosity
Negative verbosity levels don't make sense.
2022-11-01 10:19:08 +00:00
Evangelos Ribeiro Tzaras a278cb660c application: Fix indentation 2022-11-01 10:19:08 +00:00
Evangelos Ribeiro Tzaras 8173d4a9ee new-call-box: Reindent 2022-10-13 13:24:19 +00:00
Evangelos Ribeiro Tzaras 8a16439cc8 new-call-box: Switch to using CuiDialpad
It has been in libcall-ui for some time, so let's use it.

This will also easy the transition to Gtk4 as it's one less widget we
have to worry about.
2022-10-13 13:24:19 +00:00
Evangelos Ribeiro Tzaras f2a22d0c02 meson: Sort sources alphabetically 2022-09-21 12:40:31 +02:00
Evangelos Ribeiro Tzaras c3c315d8e7 application: Don't show application window if started as daemon
If calls was already running as a daemon it and were invoked again with
`--daemon` it ended up showing the UI.

Now we always set the `daemon` variable and simplify activation logic as
a side effect.

Fixes #500
2022-09-20 13:41:43 +02:00
Evangelos Ribeiro Tzaras 3badf72725 application: Don't return value in start_proper()
It never returned FALSE, so change function prototype accordingly.
2022-09-20 13:30:31 +02:00
Evangelos Ribeiro Tzaras 8c6d64ddaf ringer: Cancel any ongoing actions on shutdown 2022-09-20 12:27:38 +02:00
Evangelos Ribeiro Tzaras 97626c467f ringer: Move libfeedback related cleanup to finalize()
Leave the LfbEvent self->event alive in dispose()
to give potentially pending GAsyncReadyCallback invocations
or running GSources a better chance of finishing gracefully.
2022-09-20 12:27:26 +02:00
Evangelos Ribeiro Tzaras e28b15b41a ringer: Remove deprecated CuiCallStates
They haven't been used since
4bc8e82ff6
and could probably have been removed sooner.
2022-09-20 12:27:23 +02:00
Evangelos Ribeiro Tzaras 991512e196 record-store: Removed deprecated CuiCallStates
They haven't been used since
4bc8e82ff6
and could probably have been removed sooner.
2022-09-20 12:27:21 +02:00
Evangelos Ribeiro Tzaras 4348e794a9 manager: Remove unused include 2022-09-20 12:26:43 +02:00
Evangelos Ribeiro Tzaras 09688a1e80 call: Document call states 2022-09-01 18:08:27 +02:00
Evangelos Ribeiro Tzaras 1d20998e9a call: Prefer using enum values 2022-09-01 18:06:55 +02:00
Evangelos Ribeiro Tzaras 4592194c11 application: Fix typo in message emission 2022-09-01 18:06:55 +02:00
Evangelos Ribeiro Tzaras 5869296c14 application: Consistent use of user_data in action "activate" callbacks. 2022-09-01 18:06:55 +02:00
Evangelos Ribeiro Tzaras b893c81375 application: Whitespaces style nitpicks 2022-09-01 18:06:55 +02:00
Evangelos Ribeiro Tzaras f8c65b9326 Revert "new-call-box: Clear entry after dialing"
This reverts commit 528fb11dcd.

It is cumbersome having to retype everything
if you've made a mistake when entering a number.
2022-09-01 17:52:52 +02:00
Evangelos Ribeiro Tzaras 8a928f2008 call: Remove waiting state
The waiting state is not used any more and made wrong assumptions to
begin with, so let's get rid of it.
2022-09-01 17:48:02 +02:00
Guido Günther c893a44f9f main-window: Add translator comment to not translate the application name 2022-08-23 17:41:17 +00:00
Evangelos Ribeiro Tzaras 11ba83c16e Move plugin specific tests into dedicated directory
This will prove beneficial when we also add tests for the policy engine
plugins. The increased locality is also nice to have.
2022-08-19 08:43:57 +00:00
Evangelos Ribeiro Tzaras 55be6cd39e manager: Remove unused has_active_call() function
Introduced in f69c597387
but was never really used, so let's drop the dead code.
2022-08-10 16:00:00 +02:00
Evangelos Ribeiro Tzaras 21ae0a67c4 manager: Drop unused get_contact_name() declaration
The function has been removed since quite some time,
but the declaration did not get removed.

Fixes 889d5a0981
2022-08-10 15:07:02 +02:00
Evangelos Ribeiro Tzaras 757351b39c record-row: Add SMS action
Add a menu entry in the history popover to open the default "sms" URI
handler.

Closes: #182
2022-08-05 10:30:06 +02:00
Evangelos Ribeiro Tzaras 01f3757ce1 record-row: Simplify add-action logic
Get rid of some code by avoiding special casing
and potentially fix an issue (WIP).
2022-08-05 10:30:06 +02:00
Evangelos Ribeiro Tzaras 0d6095b42a record-row: Use STR_IS_NULL_OR_EMPTY macro 2022-08-05 10:30:06 +02:00
Evangelos Ribeiro Tzaras 8e23d77508 record-row: Chain up early to constructed() 2022-08-05 10:30:06 +02:00
Evangelos Ribeiro Tzaras d94792f3c5 record-row: Rename callback to conform to on_* naming scheme 2022-08-05 10:30:06 +02:00
Evangelos Ribeiro Tzaras 37eba7b66f record-row: Remove unused code 2022-08-05 10:30:06 +02:00
Evangelos Ribeiro Tzaras b81b216cf0 history-box: Cap size of slice at number of call records
This helps avoiding some log spam when scrolling to the bottom:

16:29:17.1053      CallsHistoryBox[2798409]:   DEBUG: Increasing history slice from 1825 to 1875
16:29:17.1215      CallsHistoryBox[2798409]:   DEBUG: Increasing history slice from 1875 to 1925
16:29:20.6739      CallsHistoryBox[2798409]:   DEBUG: Increasing history slice from 1925 to 1975
16:29:23.1919      CallsHistoryBox[2798409]:   DEBUG: Increasing history slice from 1975 to 2025
16:29:24.2533      CallsHistoryBox[2798409]:   DEBUG: Increasing history slice from 2025 to 2075

for a history of ~1400 records.
2022-07-27 16:54:26 +02:00
Evangelos Ribeiro Tzaras 9209a7801c history-box: Allow transition from non-empty to empty history
Since call records may be deleted, the transition from non-empty to
empty is also possible.
2022-07-27 16:45:42 +02:00
Evangelos Ribeiro Tzaras a6faac2940 history-box: Dynamically adjust slice list model size
The slice get's increased by 50 items if scrolled to the bottom
and reset to the initial 75 items if scrolled back to the top.

The defined threshholds make sure that the UX still feels smooth.
2022-07-27 16:29:39 +02:00
Evangelos Ribeiro Tzaras 8ae03a1321 history-box: Switch to GtkSliceListModel
Having more than ~200 widgets in a GtkListBox comes with a very
performance impact. This is especially noticable during while the main
window is being realized (even if Calls already runs in daemon mode).

We can limit the amount of widgets by using a slice list model.

Fixes: #374
2022-07-27 16:27:07 +02:00
Evangelos Ribeiro Tzaras 3568af8553 meson: Add gtk sources to build 2022-07-27 16:26:25 +02:00
Evangelos Ribeiro Tzaras 44c892b6f7 Drop use of volatile
The volatile qualifier was mostly used for historical reasons,
the documentation for `g_once_init_enter()` and `g_once_init_leave()`
has the following to say:

While `location` has a `volatile` qualifier,
this is a historical artifact and the pointer passed to it
should not be volatile.

See also https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
2022-07-27 16:26:25 +02:00
Evangelos Ribeiro Tzaras fd5a24f853 history-box: Chain up to constructed() early 2022-07-27 16:26:24 +02:00
Evangelos Ribeiro Tzaras 01aa8c04c2 Add various gtk list models
This is an exact copy from GTK4.
as grabbed by chattys commit 1ed5084fb965908e3ee0304781b0de06479c869b

Slightly adapted for Calls.

Based on GTKs 01bd4cc4e18a1ea697fe61791ba710d0d55e8290
2022-07-27 16:06:57 +02:00
Evangelos Ribeiro Tzaras 36b10bc764 new-call-box: Don't auto select offline accounts 2022-06-21 12:19:38 +02:00
Evangelos Ribeiro Tzaras ee64b33e24 new-call-box: Fix memory leak
calls_new_call_box_dial was taking a reference it never released.
2022-06-21 11:52:40 +02:00
Evangelos Ribeiro Tzaras 581c82fcd7 new-call-box: Order includes alphabetically 2022-06-21 11:52:40 +02:00
Evangelos Ribeiro Tzaras 82a03ac0b1 record-store: Add debug statement for call state changes
This can help debugging issues such as #463 and #455
2022-06-20 13:00:37 +00:00
Andrey Skvortsov e8895e9387 application: fix 'tel:' URL handling with escaped symbols
It's common to have spaces or other separator characters in telephone
numbers. If tel: link (example: tel:+1 855-698-1150) is clicked in browser all
unsupported characters are escaped (example: tel:+1%20(855)%20698-11-50).
2022-06-15 07:39:37 +00:00
Chris Talbot e91d6258ad calls-ui-call-data: change DELAY_UI_MS to 100 ms
15 ms does not seem to be enough time for phosh-antispam to be able
to hang up before the incoming call screen shows up. In my experiement,
90 looks to be the minimum time needed for the incoming call to not show up.

I put it to 100 ms just to be safe.
2022-06-11 18:56:46 -04:00
Evangelos Ribeiro Tzaras 30148cebe3 schema: Add setting allowing to use SDES
Key exchanges in SDES can only be done securely with TLS and the option
is disabled by default if not using TLS as the transport protocol.

This setting allows to override this behaviour if the user desires
it (f.e. if the user considers the network his packets go through to be trusted).
2022-05-24 22:48:59 +02:00
Evangelos Ribeiro Tzaras 1a51ce0e40 dbus-manager: Bind encrypted property 2022-05-24 22:48:59 +02:00
Evangelos Ribeiro Tzaras be235189cc call: Add "encrypted" property
This property indicates whether a call is using encryption.
2022-05-24 22:48:59 +02:00
Evangelos Ribeiro Tzaras 5cd03a8a13 dbus-manager: Remove unused variables 2022-05-24 22:30:03 +02:00
Evangelos Ribeiro Tzaras c1be092dea account-widgets: Make row activatable
This brings us closer to the intended design and let's us get rid of
some code.
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras f102fb3fcd account-widgets: Conform to style
Closes #396
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras 46ff807f6b sip: origin: Always notify state changes when relevant to the UI
by adding functions to the public API which determine if state changes
should be shown to the user and use them (instead of duplicating similar
logic).
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras 41479eea09 account-row: Use delayed state changes for GtkSwitch
When trying to go online/offline we're always waiting for confirmation
from the stack (even if it's a timeout) so the delayed pattern is a good choice.
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras 4f4c7e877e account-row: Fix header alignments
Uncrustify must have gotten confused.
2022-05-24 11:55:52 +00:00
Evangelos Ribeiro Tzaras 46f46cf3ec settings: Break settings binding cycle
This breaks the settings binding cycle for the "autoload-plugins" and
"preferred-audio-codecs" settings which went something like this:

g_settings_bind () is used with
G_SETTINGS_BIND_DEFAULT (G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET).
It grabs the value of our setting and sets it for the bound property.
This emits the notify signal causing the same value to be set for the
setting.

In effect this caused the setting to be marked as non-default because
Calls had changed the setting without user action. This caused updated
defaults not to apply for existing installations.
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras 94fa13af4c settings: Convert to the singleton pattern
We only have a single source of settings, so we should reflect that by
using a singleton. This also reduces our LoC.

This doesn't impair our ability to run tests because there we run with
GSETTINGS_BACKEND=memory
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras d28be2650b Fix header alignment
Uncrustify messed up a bit because of the it expects a semicolon for the
G_* () macros

See https://github.com/uncrustify/uncrustify/issues/3393
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras 7ac862155b Uncrustify sources
Ran `find src plugins -iname '*.[c|h]' -print0 | xargs -0 uncrustify --no-backup`
with some minimal manual intervention.
2022-04-24 12:59:42 +02:00
Evangelos Ribeiro Tzaras 69106910f8 manager: Don't raise critical when origin id lookup fails
We don't store origin ids yet
because https://gitlab.gnome.org/GNOME/calls/-/merge_requests/505
is pending on
https://gitlab.gnome.org/GNOME/gom/-/merge_requests/12 and
https://gitlab.gnome.org/GNOME/gom/-/merge_requests/13
2022-04-05 09:27:07 +02:00
Evangelos Ribeiro Tzaras 134c4af9c7 record-row: Avoid raising critical
When the record has a NULL id there won't be a CallsBestMatch we can use to bind
properties.
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras 1593625373 manager: Remove call-add and call-remove signal
They are phased out in favour of their newly introduced ui-call-* pendants.
This was done to have a better separation of concerns and allows for some
cleanup in CallsCall.

Closes #397
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras 42557bf2a1 record-store: Switch to CallsUiCallData 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras 7e538d736e ui-call-data: Provide API to get the name of the origin used
This will be used as a fallback when displaying the call details (see #222).
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras d24d1c8c59 manager: Implement lookup_origin_by_id()
This function is used in the activate callback for the per protocol dial actions
to choose the correct origin to place a call from. If an origin cannot be found
it will return NULL which will lead to the fallback "app.dial" action being
invoked.
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras 30c4e90499 ui-call-data: Store origin id and adapt to changes 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras 16b86c29b2 origin: Add id property and adapt to changes
The id property will be used to keep track of which origin was used for a call,
so that we can default to reusing the same origin when placing a call from the
history.
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras 64ff76e62f manager: Remove unused function declaration
If we have the origin, we can always go directly with calls_origin_dial().
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras 3ebc3ed88d call: Prefer pragma once over explicit include guard 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras a85f37e853 record-store: Sort include headers 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras 094d402d9b notifier: Fix logic error
After introducing the STR_IS_NULL_OR_EMPTY macro the rewrite of the logic was
inverted.

Fixes d3677ad5d1
2022-02-25 14:30:35 +01:00
Evangelos Ribeiro Tzaras d3677ad5d1 notifier: Fix expression testing if there is a contact
Previously cui_call_get_display_name() would return the ID of the caller if no
contact was found. As this has changed recently the test for got_contact broke.
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 53129e92af util: Add STR_IS_NULL_OR_EMPTY macro
Shamelessly copied from
https://gitlab.gnome.org/World/Phosh/phosh/-/blob/main/src/util.h#L13
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 5b171bf2c5 record-row: Handle calls with NULL id gracefully
Shuffles some code around so that the property bindings are at the end.
This allows us to return early if there is a NULL contact (as is the case
for anonymous callers).
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras cd075d9269 record-row: Use primary info instead of name property
RECHECK if bestmatch can ever have a NULL id!
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 7f40314810 best-match: Add property for primary and secondary display information
This allows to get rid of any special casing that the users of the
calls_best_match_get_name() and calls_best_match_get_id() had to do previously.

We also allow passing in NULL for *_get_primary_info ()
and *_get_secondary_info () for the anonymous caller case.
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 79875cb64e ui-call-data: Handle anonymous callers gracefully 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 9ffcbe2de8 contacts-provider: Don't throw a critical when trying to lookup NULL id
Anonymous callers will show up with a NULL id, so don't emit a critical here.

Fixes 006673a9e1
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras c36b6d713a call: Allow setting NULL id
A NULL id will be reported for anonymous callers.
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 73ac050cef call: Annotate properties and add introspection attributes on getters/setters
See https://gnome.pages.gitlab.gnome.org/gi-docgen/attributes.html
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 4187eec127 notifier: Codestyle 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 1e734dbbff notifier: Chain up to parents constructed() before doing anything else
Not strictly needed here, because we don't depend on the parent being
constructed but this is how it should generally be done.
2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 690ac121e9 best-match: Assert CALLS_IS_BEST_MATCH in private functions 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 51598700d7 best-match: Codestyle 2022-02-18 10:55:53 +01:00
Evangelos Ribeiro Tzaras 6e7984cb5d application: Reuse existing functions in app.dial action
For that we must move open_sip_uri() and open_tel_uri() up to avoid having to
add forward declarations.

Fixes #402
2022-02-18 09:20:07 +00:00
Evangelos Ribeiro Tzaras 006673a9e1 contacts-provider: Guard against lookup with NULL id
If the id is NULL g_str_hash(NULL) will be called which tries dereferencing the
pointer.

Fixes #408
2022-02-15 08:02:18 +01:00
Evangelos Ribeiro Tzaras 8bf2f2cf1d main-window: Bump copyright year in about window 2022-02-13 00:01:50 +01:00
Evangelos Ribeiro Tzaras f50f0b8b74 call: Add call-type property
The designs for the call details show information on the type of the call:
https://gitlab.gnome.org/Teams/Design/app-mockups/blob/master/calls/calls.png
So f.e. "Cellular", "Matrix WebRTC Video Call".

These properties can potentially also be useful in choosing the mechanism to
use for the audio controls from the call display.
2022-02-09 19:35:46 +01:00
Evangelos Ribeiro Tzaras 34b447a4ca call: Get rid of get_contact() API
This function isn't used anywhere since the recent refactoring, so let's drop
this dead code.
2022-02-09 19:35:43 +01:00
Evangelos Ribeiro Tzaras d7ba7927d7 manager: Add section documentation 2022-02-06 09:56:31 +01:00
Evangelos Ribeiro Tzaras 3fe976505c manager: Delay UI Call removal and adjust to changes
This was handled explicitly in the Call window.
By changing the logic to delay the emission of "ui-call-removed" we make sure
that the Call UI and the exported DBus object is consistent.

We also need to change the test cases to use run a GMainLoop because we now have
to wait until signal comes in.
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras cde517096b dbus: Add hint property
This is a dictionary to allow for future extensibility. Currently we're only
hinting if the UI should be shown for a given call.
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras 3d85ef802f call-window: Take ui-active property into account
Only show the display after the "pre-ring" phase has passed.

Fixes #371
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras 93cf894a8c ringer: Take ui-active property into account
Only start ringing once the UI is deemed active, i.e. the "pre-ring" phase has
passed.

Fixes #371
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras 1d5c8952ad ui-call-data: Add property to delay showing call display and ringing
This "ui-active" property should be set to FALSE for new incoming calls and set
to TRUE after a short delay of 20ms. This property is used to delay showing the
call display and starting to ring.

This delay gives DBus clients like
phosh-antispam (https://gitlab.com/kop316/phosh-antispam)
some time to make a decision whether a call should be hung up or not and defer
starting to ring and showing the display only afterwards.
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras d15614a645 selector: Fix property binding
CallsCall used "name", while CuiCall uses "display-name".
2022-02-03 07:16:04 +01:00
Evangelos Ribeiro Tzaras 896af6f8af record-row: Fix passing widget instead of string as action target
When introducing the per protocol dial actions we started setting the widget
self->target as the action target instead of the target property of
self->record.

Bizzarely we only sometimes got greeted with a critical:

11:30:20.5184                 GLib[887977]:CRITICAL: g_variant_new_string: assertion 'g_utf8_validate (string, -1, NULL)' failed

Thread 1 "gnome-calls" received signal SIGTRAP, Trace/breakpoint trap.
g_logv (log_domain=0x7ffff7ea400e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=<optimized out>) at ../../../glib/gmessages.c:1417
1417	../../../glib/gmessages.c: No such file or directory.
(gdb) bt
    at ../../../glib/gmessages.c:2898

Fixes: 687dd7ff383476523ae0a8a38879a171cb0b9a5a
Closes #398
2022-02-01 23:28:50 +01:00
Evangelos Ribeiro Tzaras d452e0a702 dbus-manager: Fix wrong property being bound
Fixes cf6c563ead
2022-02-01 23:28:50 +01:00
Evangelos Ribeiro Tzaras aa04401b06 dbus-manager: Prefer canonical signal names 2022-02-01 23:28:50 +01:00
Evangelos Ribeiro Tzaras 423ce4668e record-row: Remove unnecessary G_OBJECT cast 2022-02-01 23:28:50 +01:00
Evangelos Ribeiro Tzaras e4dc6548c5 ui-call-data: Document calls_call_state_to_cui_call_state() 2022-02-01 23:28:50 +01:00
Evangelos Ribeiro Tzaras 3fa290f5a7 notifier: Switch to CallsUiCallData 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 98b8155fc6 manager: Switch to CallsUiCallData 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras bb8f662a01 ui-call-data: Remove get_call() function
No need to expose the internal CallsCall object as all properties relevant for
the UI are proxied out anyway.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 5bca8eabfe call: Remove API for silencing
This now lives in CallsUiCallData and got removed after the last user of the
code (CallsDbusManager) switched.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras cf6c563ead dbus-manager: Switch to CallsUiCallData
This allows to simplify the code a bit.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 5b9609c4f7 ringer: Use CallsUiCallData instead of CallsCall
This will allow us to handle pre-ringing better.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras b9e49986f0 call: Remove unused calls_call_state_to_string()
We're now using cui_call_state_to_string(), so this is unused.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras fa5969892e call-window: Switch to CallsUiCallData
By connecting to the "ui-call-added" and "ui-call-removed" signals instead of
"call-add" and "call-remove".

This allows us to shave off a few lines of code.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 1d364eafda ui-call-data: Add proxy properties for CallsCall
TODO: This could do with some tests
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras dd8cc08649 ui-call-data: Allow contact provider to be NULL
The contact provider can be NULL in the ringer tests, because we're stubbing it.
Early return in that case and make sure the call is already set.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras db7674d0f9 manager: Add new set of add and remove signals for CuiCalls
This is part of a refactoring which should help separating concerns between
CallsCall and CallsUiCallData better.

To accomplish this we want to stop passing around CallsCall objects and instead
pass CallsUiCallData objects.
In this commit we added new signals instead of changing the existing ones
because that results in a lot of churn. It allows to do the switch per module
allowing smaller individual patches and a more manageable patchset.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 1518a4b6fb ui-call-data: Add "state-changed" signal
This signal is for use in the UI components that are interested in both the old
and new state.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 2f32e09982 ringer: Switch to state notify signal 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 500581d35d call: Add transfer annotation for get_protocol() 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 805ed4e0f4 notifier: Expand on comment 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 9f50bc509f notifier: Remove unused GList 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 25c2d5b104 notifier: Sort include headers 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 5e2061da46 ringer: Reorder headers
config.h goes first then sort alphabetically.
2022-02-01 06:11:04 +01:00
Evangelos Ribeiro Tzaras d75d4916af manager: Use state flags instead of an enum and adapt to changes
This gives us some more granularity and is overall a better fit than the states
previously used.

Closes #327
2022-01-31 17:08:38 +00:00
Evangelos Ribeiro Tzaras b00deccdcb record-row: Use per protocol dial action
This allows us to deactivate actions if there is no origin that can handle them.

Closes #293
2022-01-31 17:08:38 +00:00
Evangelos Ribeiro Tzaras dd4a02aea2 manager: Add per protocol dial actions
These are enabled or disabled based on availability of suitable origins.
Allows CallsCallRecordRows (GtkListBoxRows in the call history) to use protocol
specific instead of global dial action.

Closes #307
2022-01-31 17:08:38 +00:00
Evangelos Ribeiro Tzaras 15943b9776 manager: Hardcode supported protocols and adapt to changes
This simplifies the code quite a bit by removing the supported protocols from
being determined dynamically via the loaded plugins.

It was previously used to add/remove a GListStore to origins_by_protocol.

This is a prerequisite for having per protocol dial actions.
2022-01-31 17:08:38 +00:00
Evangelos Ribeiro Tzaras 18aea10ca3 manager: Remove unused key argument in g_hash_table_iter_next()
We're only interested in the value here.
2022-01-31 17:08:38 +00:00
Evangelos Ribeiro Tzaras edbf046bfd ui-call-data: Implement "active-time" property 2022-01-31 15:51:45 +01:00
Evangelos Ribeiro Tzaras 8543fc7ab5 Update libcallui subproject and adjust to CuiCallState changes
We already had our mapping between CallsCallStates and CuiCallStates in place,
but the _DIALING state got renamed to _CALLING.

Additionally bundle CallsCallStates that map to the same CuiCallState to remove
some code.
2022-01-31 15:25:46 +01:00
Evangelos Ribeiro Tzaras ab3ff5772b settings: Fix memory leak
g_settings_get_string() and g_settings_get_strv() are transfer full,
so we should use g_value_take_string() instead of g_value_set_string() and
g_value_take_boxed() instead of g_value_set_boxed()
2022-01-27 18:02:15 +01:00
Evangelos Ribeiro Tzaras 7587efb78a log: Fix One Definition Rule
As caught by running with enabled address sanitization.
2022-01-27 18:02:15 +01:00
Evangelos Ribeiro Tzaras 1d1489e167 call: Fix memory leaks 2022-01-27 18:02:15 +01:00
Evangelos Ribeiro Tzaras 9569afa073 origin: Add transfer annotation for calls_origin_get_calls () 2022-01-27 18:02:15 +01:00
Evangelos Ribeiro Tzaras a7677798d1 dbus-manager: Fix critical when transforming call states
Fixes c796df9260
2022-01-26 08:27:31 +01:00
Evangelos Ribeiro Tzaras 656643c522 call: Temporarily hold ref while setting new state
This is needed to make sure the object stays alive, because some implementations
will unref the call after it has been set to a disconnected state.

This has become apparent because tests started failing when origins switched
from the "state-changed" to the "notify::state" signal (as is done in the next
commits).
2022-01-20 10:23:09 +00:00
Evangelos Ribeiro Tzaras c594726ce5 best-match: Fix potential memory leak
We would leak memory if calls_best_match_set_phone_number would be called a
second time with a SIP address.
2022-01-20 10:23:09 +00:00
Evangelos Ribeiro Tzaras ebc5e584bb manager: Use ternary operator instead of if/else block
Less code is better code.
2022-01-20 10:23:09 +00:00
Evangelos Ribeiro Tzaras f01c99c587 ui-call-data: Remove unused struct 2022-01-20 10:23:09 +00:00
Evangelos Ribeiro Tzaras 36c4f2b349 ui-call-data: Add license header 2022-01-20 10:23:09 +00:00
Evangelos Ribeiro Tzaras 6567b7cad7 call-selector-item: Codestyle
Move public functions to the bottom
2022-01-20 10:23:09 +00:00
Evangelos Ribeiro Tzaras c0a67d2cce contacts-provider: Remove static from action name string
There was no reason to have it static in the first place.
2022-01-20 10:23:09 +00:00
Evangelos Ribeiro Tzaras 99057452c5 dbus: Document interface in a way that gtk-doc can use
Fixes #394
2022-01-20 10:50:48 +01:00
Evangelos Ribeiro Tzaras 12ae596352 contacts-provider: Overhaul documentation
This commit describes what CallsContactsProvider is used for,
documents signals, properties and the public API.
2022-01-20 10:17:26 +01:00
Evangelos Ribeiro Tzaras bcdb703ec3 origin: Remove unused parameter from docstring 2022-01-20 10:17:26 +01:00
Evangelos Ribeiro Tzaras 4dd4ba3be3 provider: Remove unused parameter from docstring 2022-01-20 10:17:26 +01:00
Evangelos Ribeiro Tzaras 52eebaad83 message-source: Fix typo 2022-01-20 10:17:26 +01:00
Evangelos Ribeiro Tzaras c796df9260 dbus-manager: Use CuiCallStates instead of CallsCallStates
CallsCallStates are considered internal call states and do not map 1:1 to
CuiCallStates.
2022-01-20 07:42:08 +00:00
Evangelos Ribeiro Tzaras e3afefcef2 ui-call-data: Add call state mapping to public API
This allows it to get used in the DBus manager in a GBindingTransformFunc
until to make sure we don't use emit deprecated values over DBus.
2022-01-20 07:42:08 +00:00
Evangelos Ribeiro Tzaras 4bc8e82ff6 ui-call-data: Don't use deprecated states in mapping
For the UI we don't distinguish between dialing and alerting or between
waiting and incoming.
2022-01-20 07:42:08 +00:00
Evangelos Ribeiro Tzaras 6e9fadbee2 dbus: document states 2022-01-20 07:42:08 +00:00
Evangelos Ribeiro Tzaras 54092e45d4 call: Fix typos in section docstring 2022-01-18 03:53:11 +00:00
Evangelos Ribeiro Tzaras 827594dc2e record-row: Add context menu entry for adding a new contact
Fixes #157
2022-01-18 02:12:37 +00:00
Evangelos Ribeiro Tzaras 5588bd934a contacts-provider: Add API to add new contacts 2022-01-18 02:12:37 +00:00
Evangelos Ribeiro Tzaras c6d867cd72 contacts-provider: Add GDBusActionGroup to query if contacts can be added
As this requires a patched GNOME Contacts, we want to be able to query if the
necessary actions to add new contacts is available before trying to use it.
2022-01-18 02:12:37 +00:00
Evangelos Ribeiro Tzaras 56da32d1b6 contacts-provider: Remove unused config.h include 2022-01-18 02:12:37 +00:00
Evangelos Ribeiro Tzaras 8ad21b211c contacts-provider: Codestyle 2022-01-18 02:12:37 +00:00
Evangelos Ribeiro Tzaras bc4ed210b2 contacts-provider: Sort includes 2022-01-18 02:12:37 +00:00
Evangelos Ribeiro Tzaras 339093876c manager: Propagate messages from account
Not all portions from the user interface are listening directly to messages from
accounts, so the manager should propagate them to allow the UI to pick them up.

Closes #340
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras cc8da717b1 account-overview: Reindent ui file
This was done to avoid the diff noise in the previous commit introducing
the in app notifications to the account overview.
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras 2a9791a9a3 account-overview: Show notification on account message
Accounts implement the CallsMessageSource interface and emit messages when
there are state changes of which the user should be informed.

Closes #340
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras 4cd3a0dcc3 account: Add message emission API
This can be used when wanting to show a human readable description in the UI
for example when the account state changes.
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras cdb6f90acc account: Rework account states
Introduce a state-changed signal which also gives a reason for why the state
changed. This will allow the UI to give some meaningful feedback to the user.

Additionally we can get rid of a number of things that were not really states,
but rather reasons for why a state changed (f.e. authentication failures).
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras 6d877fd9d3 manager: Implement message source interface
This allows the user interface to pick up messages by having them propagate
from the managed providers, origins, calls, etc.
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras 6de5e9a54c manager: Remove the "error" signal and adapt to changes
We can now use the message source interface to signal any feedback to the user.
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras d1b20bec39 message-source: Add API to emit message 2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras e148930cc4 application: Sort includes alphabetically 2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras 6a3702dea3 manager: Clean up includes
The manager is not using the account providers anywhere.
2022-01-11 12:00:10 +00:00