Revert "self-handle test: go back to reimplementing TpSvcDBusProperties"

This reverts commit 5a3524270c6d1febeccfbf636fc59b2da48f33b6.

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
test-self-handle: Fix possible race making test sometimes fail

The filter callback is ran in GDBusConnection's worker thread
so we can't be sure how stuff are ordered. By delaying the
GetAll reply and re-send it from the main thread we are sure
that the SelfContactChanged signal will be sent just after it.

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
Add sliced-gvalue to documentation

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
tp_svc_interface_skeleton_get_properties: don't leak the parent object

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
tp_dbus_connection_try_register_object: export each GDBusInterfaceSkeleton from a GDBusObject

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpSvcInterfaceSkeleton: move to the -dbus library

This requires some careful juggling to make it able to call methods
on the TpDBusPropertiesMixin without having to move the entire
TpDBusPropertiesMixin to the -dbus library.

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpBaseProtocol: be a GDBusObjectSkeleton

This means we don't need the get_interfaces_array() vfunc, because we
can inspect the GDBusObject interface to find out what our interfaces
are.

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
Add gdbus-codegen support

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
Test: Stop implementing TSvcConnection for bug 19101 regression test

TpBaseConnection is about to stop implementing it and use
gdbus-codegen's skeleton instead.

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpTestsSimpleConnection: Do not implement TpSvcConnection interface

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpBaseConnection: be a GDBusObjectSkeleton

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpBaseConnection: Stop implementing TpSvcConnection

We use gdbus-codegen's skeleton to implement Connection iface now.

[adjusted to apply on top of making it a GDBusObjectSkeleton, and
handle Interfaces accordingly -smcv]

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
tp_base_connection_change_status: emit status-changed before StatusChanged

Gabble's regression tests expect to receive PresencesChanged before
StatusChanged, and PresencesChanged is triggered by the status-changed
GObject signal.

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
tp_svc_interface_skeleton_emit_signal: ignore if no longer exported

Because GDBusObjectSkeleton holds a ref to all its interface skeletons
as long as the parent object exists, it's possible that they will
have been unexported but not freed.

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpBaseConnection::status-changed: correct a comment

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpBaseConnection: replace copy/free with g_dbus_method_invocation_take_error()

The instance in ensure_handle_cb() is not obviously correct, but
in fact @error is not used after this point, so it doesn't need setting
to NULL.

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpBaseConnection: use g_dbus_method_invocation_return_error_literal

This avoids putting a temporary GError on the stack, which was always
slightly questionable use of the GError API.

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpBaseConnection: add a static assertion that guint is guint32

In principle, this could be false, but in the real world,
sizeof(int) is a power of 2, computers with 16-bit int are
decades obsolete, and if int was 64-bit or larger, there'd be a
problem with int16_t and int32_t ('short' can only be one of those).

With this static assertion in place, we could even change TpHandle
to be guint32, although there isn't necessarily much point.

Reviewed-by: Xavier Claessens <xavier.claessens@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
Tests: fix TpChannelManager implementations

They should remove the channel from their internal table before
emitting channel-closed. That way foreach_channel() won't return
closed channel from within channel-closed cb.

Also fix a crash in example call-manager.c if foreach_channel()
is called after close_all()

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189
TpBaseConnection: Stop implementing TpSvcConnectionInterfaceRequests

Re-implemented it using gdbus-codegen's skeleton.

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189