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.
This let's us get rid of a lot of duplication in the derived classes.
Additionally we set the initial state to CALLS_CALL_STATE_INCOMING if
inbound is TRUE and CALLS_CALL_STATE_DIALING otherwise.
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
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.
This reverts the main part of commit 4a264252a7.
As plugins are the prime use case for `shared_module`
getting rid of the warning from meson about linking against shared modules
weighs less heavy.
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.
This is part of a larger refactoring effort, with the goal to replace
all the get_*() member functions in provider abstraction interfaces with
GObject properties. See also: https://source.puri.sm/Librem5/calls/issues/6
How `g_type_class_peek ()` was used it didn't return the correct parent
class in most cases.
G_DEFINE_TYPE macro creates a pointer we can use to get the parent
class `n_p_parent_class`.
Because we didn't use the correct parent class the object initialisation
wasn't fully completed for some GtkWidgets.
See https://developer.gnome.org/gobject/stable/chapter-gobject.html#gobject-instantiation
for more information.
This commit makes use of the `n_p_parent_class pointer` created for this
specific use case where ever possible.
Fixes: https://source.puri.sm/Librem5/calls/issues/118
Clean up the disconnect messages so they make sense when presented to
the user. Also add new state change reasons from ModemManager 1.10
and 1.12.
Fixes#90
We want to remove the modem if the currently removed interface is
Voice. It was previously removing the device if the removed
interface wasn’t Voice.
Fixes https://source.puri.sm/Librem5/calls/issues/94
This actually makes sense in the mapping; the only time an MM call is
in MM_CALL_STATE_UNKNOWN is when it's an outgoing call that hasn't
been started. It also helps avoid a lot of needless issues dealing
with the Calls call state.