1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-09 05:19:34 +00:00
Commit graph

21 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras d3e42c93cd refactor: Switch to CallsPluginManager 2023-05-20 04:04:50 +02: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 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 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 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 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 33ad4dbe86 Simplify country code handling 2021-09-27 08:46:09 +00:00
Evangelos Ribeiro Tzaras cc3a562f03 manager: Add API to query loaded providers 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 4f6fb722b1 application: Allow invoking with multiple -p arguments
When calls is invoked with one or more `--provider` arguments,
the application will only load the providers specified by the command line.

If no `--provider` argument is given, the application will instead fall back
to loading providers defined in the settings (see next commit).
2021-06-26 08:57:53 +02:00
Evangelos Ribeiro Tzaras 4990529c6c tests: manager: Add multiple provider tests
The test suite can be further expanded later. For now this suffices to
have some basic regression testing for multiple provider support in place.
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras 44f2002f86 manager: Differentiate the NO_ORIGIN state
This avoids confusion when only the SIP plugin is loaded, but no account
is being used.

For this we introduce two new functions in the abstract CallsProvider class:
`is_modem()` to indicate whether the the provider deals with PTSN telephony and
`is_operational()` which by default simply checks if there any avalaible origins
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras 98d66743a1 application: Don't add a provider if one is already present
If we initially invoked `gnome-calls -p sip` and later invoke
`gnome-calls sip:user@host` we don't expect to have the default MM provider
added.
2021-06-01 14:52:23 +02:00
Evangelos Ribeiro Tzaras 0b2f146053 manager: support multiple providers
This includes the following changes:
- Introduce a `providers` hash table to keep track of multiple CallProvider's
  and remove the `provider` member
- Remove `calls_manager_get_provider()` and `calls_manager_set_provider()`
  in favour of `calls_manager_add_provider()`, `calls_manager_remove_provider()`
  and `calls_manager_has_provider()`
- Introduce a `origins` GListStore to keep track of available origins.
  `origins` is updated in `items_changed_cb()` when the origins of any
  CallsProvider are updated.
- Adapt to changes with respect to `calls_manager_get_origins()`.
- Introduce `origins_by_protocol` hash table to keep track of available origins
  per protocol.
- Adjust tests
- We temporarily break country code lookup which was handled previously
  with the "default-origin" mechanism. We will add it back to the CallsSettings
  class which will provide a better application-wide mechanism.
2021-06-01 14:52:18 +02:00
Evangelos Ribeiro Tzaras 24f53cd927 manager: remove unused function 2021-03-15 09:24:46 +00:00
Mohammed Sadiq eda460ac15 provider: Use GListModel to track origins
And adapt to changes

It's easier to track changes if we are using GListModel than
a GList.  Also, eventually we shall have multiple providers,
and we can use GtkFlattenListModel to merge multiple origins
without manually managing pointers ourself.

Since several widgets has APIs to handle GListModels, it will
also help us create widgets from GListModels easily.
2021-02-25 08:44:56 +05:30
Julian Sparber f61ae1cba1 Contacts: replace CallsContacts with CallsContactsProvider 2021-02-03 23:28:56 +01:00
Evangelos Ribeiro Tzaras f69c597387 manager: add has_active_call() and hang_up_all_calls() 2021-01-12 16:47:36 +01:00
Evangelos Ribeiro Tzaras 9fc8ec5e1a Implement contact name lookup for call display
* src/calls-manager.h: Add lookup function to header
* src/calls-manager.c: Implement lookup function to be used for the call
  history, call notifier and call display
* src/calls-call-holder.c: Use calls_manager_get_contact_name ()
* src/calls-notifier.c: Use calls_manager_get_contact_name ()
2020-06-27 17:35:54 +02:00
Julian Sparber 9055724f33
Add a CallsManager and move Provider handling to it
The manager is a central place for handling data e.g. calls history and
provider managment.

This introduces only the base for feature work. Therefore it manages
only the provider for now, but the manager isn't yet used anywhere.

The propagets events from the provider and origins. It also adds a new
signal called `error`. The `error` signal should be emited only when
something went wrong and we need to inform the user about it, containing
the message to be displayed to the user. Windows should connect to the
event and display a in-app-notification on error. This event isn't
emitted, because the plugins don't give us a usable error.
2020-03-27 12:05:32 +01:00