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

43 commits

Author SHA1 Message Date
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 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 6a3702dea3 manager: Clean up includes
The manager is not using the account providers anywhere.
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras eab45610bd manager: Codestyle
We use two empty lines between functions, unless they are documented with
docstrings in which case there is only one empty line.
2022-01-11 12:00:10 +00:00
Evangelos Ribeiro Tzaras 94d730c3ed Let provider plugin decide whether to automatically hang up secondary calls
Revert "manager: hang up secondary calls"

This reverts commit 94345e0916 and moves that
functionality to the ModemManager plugin.

Fixes #290
2021-10-22 06:00:45 +02:00
Evangelos Ribeiro Tzaras 33ad4dbe86 Simplify country code handling 2021-09-27 08:46:09 +00:00
Evangelos Ribeiro Tzaras a85b9cd5c3 manager: Initialize g_auto variable to NULL 2021-08-25 11:06:32 +02:00
Evangelos Ribeiro Tzaras d5bf31bdaf manager: Temporarily hold a reference to provider being unloaded 2021-07-20 10:17:17 +02:00
Evangelos Ribeiro Tzaras 2b31a9677e manager: Emit signal when loaded providers have changed 2021-07-20 10:17:17 +02: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 23e7fd3a60 manager: Don't use peas_engine_prepend_search_path
as it does not really "prepend" the search path.
See https://gitlab.gnome.org/GNOME/libpeas/-/issues/19

Closes #300
2021-06-29 14:47:03 +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 dbb829be06 debug: Add G_LOG_DOMAIN to every file using g_debug() 2021-06-18 11:12:13 +02:00
Evangelos Ribeiro Tzaras ccae753194 manager: codestyle 2021-06-11 17:50:42 +02:00
Evangelos Ribeiro Tzaras ddcd91d3d9 manager: Fix whitespace 2021-06-11 17:50:22 +02:00
Evangelos Ribeiro Tzaras cb533aabb7 manager: Update country code
By connecting to the "notify::country-code" signal of our origins.
2021-06-01 14:52:23 +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 fecdc1fff8 cleanup: Fix calls_origin_get_name() related memory leaks
Document calls_origin_get_name() correctly as transfer-full.
Additionaly fix related memory leaks.
2021-05-28 13:18:24 +02:00
Evangelos Ribeiro Tzaras 2ac43f391a manager: Set peas search path only once
There is no need to redo it for every added plugin.
2021-05-20 02:52:11 +02:00
Evangelos Ribeiro Tzaras f9a324fc6f manager: add debug messages when adding or removing origins 2021-04-27 11:39:09 +02:00
Evangelos Ribeiro Tzaras 8a4d408f3f manager: remove unused CallsProvider argument from functions
Both add_origin() and remove_origin() don't really need it.
2021-04-27 11:39:09 +02:00
Evangelos Ribeiro Tzaras d0194fe534 manager: g_assert in static functions 2021-04-25 18:12:59 +02:00
Evangelos Ribeiro Tzaras 0bd6d7f2a5 best-match: Lookup contact if country code changed
Closes #217
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 25d651c834 manager: set default origin
This is a bit of a hack to get the country code property hooked up
and will require a rework when multiple provider support is being added.
As the default origin is not being used anywhere else in the code
it's currently not a problem that we're not tracking if the default
origin is being removed.

Additionally test-manager.c needed some adjustment.
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 7d69d78b70 origin: Add country-code property
And add a binding in CallsManager for the default origin
2021-04-06 14:27:26 +00:00
Evangelos Ribeiro Tzaras 9e92fb88af provider: Add API for loading and unloading provider plugins
This is also used for our tests. In order to avoid code duplication
this is being moved to calls-provider.{c,h}.
2021-04-05 06:13:44 +00:00
Guido Günther b04d564bcf manager: Allow to add plugin dir via environent
This eases testing of plugins from the source tree:

  CALLS_PLUGIN_DIR=_build/plugins/dummy/ _build/src/gnome-calls -p dummy
2021-04-01 14:07:27 +02:00
Evangelos Ribeiro Tzaras 94345e0916 manager: hang up secondary calls 2021-03-15 09:24:46 +00: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 889d5a0981 CallManager: drop calls_manager_get_contact_name ()
This function is replaced with calls_call_get_contact ()
2021-02-03 23:58:31 +00:00
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 4602cca37d manager: remove trailing whitespace 2021-01-12 16:47:36 +01:00
Daniel Abrecht 4e7a0b8151 Replace CallsOrigin getters with properties and add calls_origin_foreach_call method 2020-12-07 17:25:33 +00:00
Mohammed Sadiq 949ef90e03 manager: Hook to ussd signals from provider 2020-11-03 08:19:03 +05:30
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