diff options
49 files changed, 1405 insertions, 719 deletions
@@ -1,11 +1,169 @@ -telepathy-glib 0.23.0 (UNRELEASED) +telepathy-glib 0.24.1 (2014-08-25) ================================== Fixes: +• base-client: fix potential uninitialized variable bug (Guillaume) +• Fix a potential crash in contact-list example (fd.o #79006, Guillaume) + + +telepathy-glib 0.24.0 (2014-03-26) +================================== + +The “space Tolkien” release. + +Fixes since 0.23.3: + +• don't leak every D-Bus method call result, a regression in 0.23.1 (Simon) + +telepathy-glib 0.23.3 (2014-03-18) +================================== + +This is the release candidate for the future 0.24.0 stable release. + +Enhancements: + +• TpProtocol gained API to access to its immutable properties as a + GVariant. (fd.o #55108, Guillaume) + +• TpCallStream and TpCallContent now inherit the factory from their + TpCallChannel. (fd.o #76168, Guillaume) + +Fixes: + +• fix a memory leak when cleaning up TpProxy "prepare" requests + (fd.o #76000, Simon) + +• fix a memory leak for paths to contacts' avatar data (fd.o #76000, Simon) + +• fix crashes in TpFileTransferChannel with GLib 2.39 (fd.o #72319, Xavier) + +• fix some paths memory leaks (fd.o #76119, Guillaume) + +• tp_list_connection_managers_async() now terminates properly if there is no + CM installed. (fd.o #68892, Guillaume) + +telepathy-glib 0.23.2 (2014-02-26) +================================== + +Enhancements: + +• TpBaseConnection now has an "account-path-suffix" property + (fd.o #74030, Xavier) + +• New high level TpAccountChannelRequest API, including tubes, Conference and + SMSChannel. (fd.o #75450, Guillaume) + +• 'TargetHandleType: None' is now automatically added when requesting a + channel with TpAccountChannelRequest if no handle type has been defined. + (fd.o #75450, Guillaume) + +telepathy-glib 0.23.1 (2014-02-04) +================================== + +The “undead space elves” release. + +Dependencies: + +• GLib 2.36 or later is required + +Deprecations: + +• TpPresenceMixin: optional arguments are deprecated, apart from a + string named "message". This matches our current D-Bus API. + +Enhancements: + +• tp_protocol_normalize_contact_async(), + tp_protocol_identify_account_async(), and high-level API for + the Protocol Addressing and Presence interfaces (fd.o #71048, Simon) + +• More accessors for TpPresenceStatusSpec, which is now a boxed type + (fd.o #71048, Simon) + +• tp_connection_manager_param_dup_variant_type() (fd.o #71093, Simon) + +• Better debug output (fd.o #68390, #71048; Simon) + +Fixes: + +• In the examples, specifically ask for "TelepathyGlib-0.12" (this API + version), not Telepathy 1.0 (fd.o #49737, Simon) + +• Improve tests' isolation from the real session bus (Xavier) + +• Fix a critical warning for each new connection under GLib 2.39 + (fd.o #72303, Xavier) + +• Fix some possible crashes in file transfer channels, particularly + under GLib 2.39 (fd.o #72319, Xavier) + +• Correct tp_account_request_set_avatar documentation (Xavier) + +• Fix a TpConnection reference-leak in TpBaseClient (Guillaume) + +telepathy-glib 0.23.0 (2013-10-28) +================================== + +We no longer guarantee compatible upgrades within a development (odd) branch, +see README for details. + +Dependencies: + +• GLib 2.34 or later is required. + +Enhancements: + +• Spec 0.27.3 + · added Conn.I.Sidecars1 + · added Conn.I.Renaming + · added CD.I.Messages1 + +• TpAccount::avatar-changed signal (fd.o #52938, Guillaume) + +• tp_value_array_free: equivalent of g_value_array_free but does not provoke + deprecation warnings from GLib (fd.o #69849, Simon) + +• tp_account_is_prepared and tp_account_manager_is_prepared are now deprecated + (Guillaume) + +Fixes: + +• tp_contact_set_attributes: don't warn on genuinely absent interfaces + (fd.o #68149, Simon) + +• channel-group: don't crash if no message has been provided (Guillaume) + +telepathy-glib 0.22.0 (2013-10-02) +================================== + +The “don't starve” release. + +This is a new stable branch, recommended for use with GNOME 3.10. + +Fixes since 0.21.2: + +• When an avatar is downloaded, announce the change to the avatar token + immediately; if the avatar changes from A to B while we're still doing the + asynchronous file saving, don't set A as the new avatar when it has been + saved. Regression in 0.21.2. (fd.o #70010, Simon) + • Don't crash if the AccountManager returns an incorrect type for the Avatar (fd.o #69849, Simon) +Significant changes since the previous stable branch, 0.20.x: + +• tp_connection_get_self_contact() now returns NULL if the contact's + connection has been invalidated, in order to break a reference cycle + +• Avatars are saved to the cache asynchronously + +• TpBaseConnection implements SelfID, SelfContactChanged according to + telepathy-spec 0.27.2 + +• TpAccount:uri-schemes property, with change notification requiring + Mission Control 5.15+ + telepathy-glib 0.21.2 (2013-09-24) ================================== @@ -300,7 +458,7 @@ Fixes: • Fix generation of reentrant-methods.list in highly parallel builds (fd.o #52480, Ross Burton) -• TpBaseChannel: assert that the subclass sets TargetEntityType. (Will) +• TpBaseChannel: assert that the subclass sets TargetHandleType. (Will) telepathy-glib 0.19.5 (2012-07-24) ================================== diff --git a/configure.ac b/configure.ac index 3cee9a954..ee9288eff 100644 --- a/configure.ac +++ b/configure.ac @@ -87,7 +87,7 @@ PKG_PROG_PKG_CONFIG([0.21]) GTK_DOC_CHECK([1.17],[--flavour no-tmpl]) -GOBJECT_INTROSPECTION_CHECK([1.30]) +GOBJECT_INTROSPECTION_CHECK([1.41]) TP_MAJOR_VERSION=tp_glib_major_version TP_MINOR_VERSION=tp_glib_minor_version diff --git a/docs/reference/telepathy-farstream/telepathy-farstream-1-docs.sgml b/docs/reference/telepathy-farstream/telepathy-farstream-1-docs.sgml index 11bd7951e..ec50c8611 100644 --- a/docs/reference/telepathy-farstream/telepathy-farstream-1-docs.sgml +++ b/docs/reference/telepathy-farstream/telepathy-farstream-1-docs.sgml @@ -6,7 +6,7 @@ <title>telepathy-farstream Reference Manual</title> <releaseinfo> The latest version of this documentation can be found on-line at - <ulink role="online-location" url="http://telepathy.freedesktop.org/doc/telepathy-farstream/">http://telepathy.freedesktop.org/telepathy-farstream/</ulink>. + <ulink role="online-location" url="http://telepathy.freedesktop.org/doc/telepathy-farstream-1/">http://telepathy.freedesktop.org/telepathy-farstream/</ulink>. </releaseinfo> </bookinfo> diff --git a/docs/reference/telepathy-glib/telepathy-glib-docs.sgml b/docs/reference/telepathy-glib/telepathy-glib-docs.sgml index 253e68f4a..e738b8e09 100644 --- a/docs/reference/telepathy-glib/telepathy-glib-docs.sgml +++ b/docs/reference/telepathy-glib/telepathy-glib-docs.sgml @@ -9,7 +9,7 @@ <releaseinfo> This manual documents telepathy-glib version &tpglibversion;. The latest development version of this documentation can be found here: - <ulink role="online-location" url="http://telepathy.freedesktop.org/doc/telepathy-glib/">online copy of the telepathy-glib API Reference Manual</ulink>. + <ulink role="online-location" url="http://telepathy.freedesktop.org/doc/telepathy-glib-1/">online copy of the telepathy-glib API Reference Manual</ulink>. </releaseinfo> </bookinfo> diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt index 40757fa99..08f17e7d1 100644 --- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt @@ -4902,7 +4902,7 @@ TpBaseContactListDupContactsFunc tp_base_contact_list_dup_contacts TpBaseContactListDupStatesFunc tp_base_contact_list_dup_states -TpBaseContactListUIntFunc +TpMutableContactGroupListUIntFunc TpBaseContactListAsyncFunc TpBaseContactListAsyncFinishFunc tp_base_contact_list_download_async @@ -4912,73 +4912,90 @@ tp_base_contact_list_fill_contact_attributes <SUBSECTION changes> TP_TYPE_MUTABLE_CONTACT_LIST TpMutableContactListInterface +TpMutableContactList +TpMutableContactGroupListAsyncFinishFunc +TpMutableContactListAsyncFinishFunc +TpMutableContactListBooleanFunc +tp_mutable_contact_list_true_func +tp_mutable_contact_list_false_func tp_base_contact_list_can_change_contact_list tp_base_contact_list_get_request_uses_message -TpBaseContactListRequestSubscriptionFunc -tp_base_contact_list_request_subscription_async -tp_base_contact_list_request_subscription_finish -TpBaseContactListActOnContactsFunc -tp_base_contact_list_authorize_publication_async -tp_base_contact_list_authorize_publication_finish -tp_base_contact_list_store_contacts_async -tp_base_contact_list_store_contacts_finish -tp_base_contact_list_remove_contacts_async -tp_base_contact_list_remove_contacts_finish -tp_base_contact_list_unsubscribe_async -tp_base_contact_list_unsubscribe_finish -tp_base_contact_list_unpublish_async -tp_base_contact_list_unpublish_finish +TpMutableContactListRequestSubscriptionFunc +tp_mutable_contact_list_request_subscription_async +tp_mutable_contact_list_request_subscription_finish +TpMutableContactListActOnContactsFunc +tp_mutable_contact_list_authorize_publication_async +tp_mutable_contact_list_authorize_publication_finish +tp_mutable_contact_list_store_contacts_async +tp_mutable_contact_list_store_contacts_finish +tp_mutable_contact_list_remove_contacts_async +tp_mutable_contact_list_remove_contacts_finish +tp_mutable_contact_list_unsubscribe_async +tp_mutable_contact_list_unsubscribe_finish +tp_mutable_contact_list_unpublish_async +tp_mutable_contact_list_unpublish_finish <SUBSECTION groups> TP_TYPE_CONTACT_GROUP_LIST +TpContactGroupList TpContactGroupListInterface -TpBaseContactListNormalizeFunc -tp_base_contact_list_normalize_group -TpBaseContactListDupContactGroupsFunc -tp_base_contact_list_dup_contact_groups -TpBaseContactListDupGroupsFunc -tp_base_contact_list_dup_groups -TpBaseContactListDupGroupMembersFunc -tp_base_contact_list_dup_group_members -tp_base_contact_list_group_renamed -tp_base_contact_list_groups_changed -tp_base_contact_list_one_contact_groups_changed -tp_base_contact_list_groups_created -tp_base_contact_list_groups_removed -tp_base_contact_list_has_disjoint_groups +TpContactGroupListBooleanFunc +tp_contact_group_list_false_func +TpContactGroupListNormalizeFunc +tp_contact_group_list_normalize_group +TpContactGroupListDupContactGroupsFunc +tp_contact_group_list_dup_contact_groups +TpContactGroupListDupGroupsFunc +tp_contact_group_list_dup_groups +TpContactGroupListDupGroupMembersFunc +tp_contact_group_list_dup_group_members +tp_contact_group_list_group_renamed +tp_contact_group_list_groups_changed +tp_contact_group_list_one_contact_groups_changed +tp_contact_group_list_groups_created +tp_contact_group_list_groups_removed +tp_contact_group_list_has_disjoint_groups <SUBSECTION mutable-groups> TP_TYPE_MUTABLE_CONTACT_GROUP_LIST +TpMutableContactGroupList TpMutableContactGroupListInterface -TpBaseContactListSetContactGroupsFunc -tp_base_contact_list_set_contact_groups_async -tp_base_contact_list_set_contact_groups_finish -TpBaseContactListGroupContactsFunc -tp_base_contact_list_add_to_group_async -tp_base_contact_list_add_to_group_finish -tp_base_contact_list_remove_from_group_async -tp_base_contact_list_remove_from_group_finish -tp_base_contact_list_set_group_members_async -tp_base_contact_list_set_group_members_finish -TpBaseContactListRemoveGroupFunc -tp_base_contact_list_remove_group_async -tp_base_contact_list_remove_group_finish -TpBaseContactListRenameGroupFunc -tp_base_contact_list_rename_group_async -tp_base_contact_list_rename_group_finish +TpMutableContactGroupListSetContactGroupsFunc +tp_mutable_contact_group_list_set_contact_groups_async +tp_mutable_contact_group_list_set_contact_groups_finish +TpMutableContactGroupListGroupContactsFunc +tp_mutable_contact_group_list_add_to_group_async +tp_mutable_contact_group_list_add_to_group_finish +tp_mutable_contact_group_list_remove_from_group_async +tp_mutable_contact_group_list_remove_from_group_finish +tp_mutable_contact_group_list_set_group_members_async +tp_mutable_contact_group_list_set_group_members_finish +TpMutableContactGroupListRemoveGroupFunc +tp_mutable_contact_group_list_remove_group_async +tp_mutable_contact_group_list_remove_group_finish +TpMutableContactGroupListRenameGroupFunc +tp_mutable_contact_group_list_rename_group_async +tp_mutable_contact_group_list_rename_group_finish tp_base_contact_list_get_group_storage <SUBSECTION blocking> TP_TYPE_BLOCKABLE_CONTACT_LIST +TpBlockableContactListDupContactsFunc +TpBlockableContactListActOnContactsFunc +TpBlockableContactListAsyncFinishFunc +TpBlockableContactListBooleanFunc TpBlockableContactListInterface -TpBaseContactListBlockContactsWithAbuseFunc +TpBlockableContactList +TpBlockableContactListBlockContactsWithAbuseFunc +tp_blockable_contact_list_false_func +tp_blockable_contact_list_true_func tp_base_contact_list_can_block -tp_base_contact_list_is_blocked -tp_base_contact_list_dup_blocked_contacts -tp_base_contact_list_block_contacts_async -tp_base_contact_list_block_contacts_finish -tp_base_contact_list_block_contacts_with_abuse_async -tp_base_contact_list_block_contacts_with_abuse_finish -tp_base_contact_list_unblock_contacts_async -tp_base_contact_list_unblock_contacts_finish -tp_base_contact_list_contact_blocking_changed +tp_blockable_contact_list_is_blocked +tp_blockable_contact_list_dup_blocked_contacts +tp_blockable_contact_list_block_contacts_async +tp_blockable_contact_list_block_contacts_finish +tp_blockable_contact_list_block_contacts_with_abuse_async +tp_blockable_contact_list_block_contacts_with_abuse_finish +tp_blockable_contact_list_unblock_contacts_async +tp_blockable_contact_list_unblock_contacts_finish +tp_blockable_contact_list_contact_blocking_changed <SUBSECTION Standard> tp_base_contact_list_get_type TpBaseContactListPrivate @@ -4990,17 +5007,21 @@ TP_BASE_CONTACT_LIST_GET_CLASS TP_IS_BASE_CONTACT_LIST TP_IS_BASE_CONTACT_LIST_CLASS TP_IS_MUTABLE_CONTACT_LIST +TP_MUTABLE_CONTACT_LIST TP_MUTABLE_CONTACT_LIST_GET_INTERFACE tp_mutable_contact_list_get_type TP_IS_BLOCKABLE_CONTACT_LIST +TP_BLOCKABLE_CONTACT_LIST TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE tp_blockable_contact_list_get_type TP_IS_CONTACT_GROUP_LIST TP_CONTACT_GROUP_LIST_GET_INTERFACE +TP_CONTACT_GROUP_LIST tp_contact_group_list_get_type TP_IS_MUTABLE_CONTACT_GROUP_LIST TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE tp_mutable_contact_group_list_get_type +TP_MUTABLE_CONTACT_GROUP_LIST </SECTION> <SECTION> diff --git a/examples/client/dbus-tubes/offerer.c b/examples/client/dbus-tubes/offerer.c index db5165ca1..73d5c58ee 100644 --- a/examples/client/dbus-tubes/offerer.c +++ b/examples/client/dbus-tubes/offerer.c @@ -56,7 +56,7 @@ handle_method_call ( } else /* hooray! */ { - guint x, y; + gint x, y; gboolean ret; g_variant_get (parameters, "(ii)", &x, &y); diff --git a/examples/client/media-observer.c b/examples/client/media-observer.c index 0fe95e53f..5e4300522 100644 --- a/examples/client/media-observer.c +++ b/examples/client/media-observer.c @@ -51,7 +51,9 @@ observe_channel_cb (TpSimpleObserver *self, requested? "to": "from", tp_channel_get_identifier (channel)); - g_signal_connect (g_object_ref (channel), "invalidated", + g_object_ref (channel); + + g_signal_connect (channel, "invalidated", G_CALLBACK (chan_invalidated_cb), NULL); tp_observe_channel_context_accept (context); diff --git a/examples/client/text-handler.c b/examples/client/text-handler.c index 5577ad91b..25db0dfd4 100644 --- a/examples/client/text-handler.c +++ b/examples/client/text-handler.c @@ -85,16 +85,18 @@ handle_channel_cb (TpSimpleHandler *self, TpHandleChannelContext *context, gpointer user_data) { + TpTextChannel *text_chan = TP_TEXT_CHANNEL (channel); + g_print ("Handling text channel with %s\n", tp_channel_get_identifier (channel)); - g_signal_connect (channel, "message-received", + g_signal_connect (text_chan, "message-received", G_CALLBACK (message_received_cb), NULL); /* The default TpAutomaticClientFactory used by * tp_account_manager_dup() has already prepared * TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, if possible. */ - display_pending_messages (TP_TEXT_CHANNEL (channel)); + display_pending_messages (text_chan); tp_handle_channel_context_accept (context); } diff --git a/examples/cm/contactlist/contact-list.c b/examples/cm/contactlist/contact-list.c index 3a5ca8501..2107d3699 100644 --- a/examples/cm/contactlist/contact-list.c +++ b/examples/cm/contactlist/contact-list.c @@ -279,7 +279,7 @@ ensure_tag (ExampleContactList *self, g_hash_table_insert (self->priv->all_tags, r, r); if (emit_signal) - tp_base_contact_list_groups_created ((TpBaseContactList *) self, + tp_contact_group_list_groups_created ((TpContactGroupList *) self, &s, 1); } @@ -287,7 +287,8 @@ ensure_tag (ExampleContactList *self, } static void -example_contact_list_set_contact_groups_async (TpBaseContactList *contact_list, +example_contact_list_set_contact_groups_async ( + TpMutableContactGroupList *contact_list, TpHandle contact, const gchar * const *names, gsize n, @@ -305,12 +306,14 @@ example_contact_list_set_contact_groups_async (TpBaseContactList *contact_list, for (i = 0; i < n; i++) ensure_tag (self, names[i], FALSE); - tp_base_contact_list_groups_created (contact_list, names, n); + tp_contact_group_list_groups_created (TP_CONTACT_GROUP_LIST (contact_list), + names, n); d = ensure_contact (self, contact, &created); if (created) - tp_base_contact_list_one_contact_changed (contact_list, contact); + tp_base_contact_list_one_contact_changed ( + TP_BASE_CONTACT_LIST (contact_list), contact); if (d->tags == NULL) d->tags = g_hash_table_new (g_str_hash, g_str_equal); @@ -348,7 +351,8 @@ next_hash_element: continue; } - tp_base_contact_list_one_contact_groups_changed (contact_list, contact, + tp_contact_group_list_one_contact_groups_changed ( + TP_CONTACT_GROUP_LIST (contact_list), contact, (const gchar * const *) new_names->pdata, new_names->len, (const gchar * const *) old_names->pdata, old_names->len); g_ptr_array_unref (old_names); @@ -599,13 +603,15 @@ send_updated_roster (ExampleContactList *self, } static void -example_contact_list_set_group_members_async (TpBaseContactList *contact_list, +example_contact_list_set_group_members_async ( + TpMutableContactGroupList *contact_list, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); + TpContactGroupList *contact_group = TP_CONTACT_GROUP_LIST (contact_list); TpHandleSet *new_contacts = tp_handle_set_new (self->priv->contact_repo); TpHandleSet *added = tp_handle_set_new (self->priv->contact_repo); TpHandleSet *removed = tp_handle_set_new (self->priv->contact_repo); @@ -655,14 +661,15 @@ example_contact_list_set_group_members_async (TpBaseContactList *contact_list, } if (!tp_handle_set_is_empty (new_contacts)) - tp_base_contact_list_contacts_changed (contact_list, new_contacts, NULL); + tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (contact_list), + new_contacts, NULL); if (!tp_handle_set_is_empty (added)) - tp_base_contact_list_groups_changed (contact_list, added, &group, 1, + tp_contact_group_list_groups_changed (contact_group, added, &group, 1, NULL, 0); if (!tp_handle_set_is_empty (removed)) - tp_base_contact_list_groups_changed (contact_list, removed, NULL, 0, + tp_contact_group_list_groups_changed (contact_group, removed, NULL, 0, &group, 1); tp_handle_set_destroy (added); @@ -673,13 +680,15 @@ example_contact_list_set_group_members_async (TpBaseContactList *contact_list, } static void -example_contact_list_add_to_group_async (TpBaseContactList *contact_list, +example_contact_list_add_to_group_async ( + TpMutableContactGroupList *contact_list, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); + TpContactGroupList *contact_group = TP_CONTACT_GROUP_LIST (contact_list); TpHandleSet *new_contacts = tp_handle_set_new (self->priv->contact_repo); TpHandleSet *new_to_group = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; @@ -713,10 +722,11 @@ example_contact_list_add_to_group_async (TpBaseContactList *contact_list, } if (!tp_handle_set_is_empty (new_contacts)) - tp_base_contact_list_contacts_changed (contact_list, new_contacts, NULL); + tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (contact_list), + new_contacts, NULL); if (!tp_handle_set_is_empty (new_to_group)) - tp_base_contact_list_groups_changed (contact_list, new_to_group, &group, 1, + tp_contact_group_list_groups_changed (contact_group, new_to_group, &group, 1, NULL, 0); tp_handle_set_destroy (new_to_group); @@ -726,13 +736,15 @@ example_contact_list_add_to_group_async (TpBaseContactList *contact_list, } static void -example_contact_list_remove_from_group_async (TpBaseContactList *contact_list, +example_contact_list_remove_from_group_async ( + TpMutableContactGroupList *contact_list, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); + TpContactGroupList *contact_group = TP_CONTACT_GROUP_LIST (contact_list); TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; @@ -752,7 +764,7 @@ example_contact_list_remove_from_group_async (TpBaseContactList *contact_list, } if (!tp_handle_set_is_empty (changed)) - tp_base_contact_list_groups_changed (contact_list, changed, NULL, 0, + tp_contact_group_list_groups_changed (contact_group, changed, NULL, 0, &group, 1); tp_handle_set_destroy (changed); @@ -838,8 +850,12 @@ receive_auth_request (ExampleContactList *self, g_message ("From server: %s has cancelled their publish request", tp_handle_inspect (self->priv->contact_repo, contact)); - d->publish = FALSE; - d->pre_approved = FALSE; + if (d) + { + d->publish = FALSE; + d->pre_approved = FALSE; + } + g_hash_table_remove (self->priv->publish_requests, GUINT_TO_POINTER (contact)); tp_handle_set_add (self->priv->cancelled_publish_requests, contact); @@ -1023,7 +1039,7 @@ example_contact_list_dup_contacts (TpBaseContactList *contact_list) } static TpHandleSet * -example_contact_list_dup_group_members (TpBaseContactList *contact_list, +example_contact_list_dup_group_members (TpContactGroupList *contact_list, const gchar *group) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); @@ -1100,7 +1116,7 @@ example_contact_list_dup_states (TpBaseContactList *contact_list, static void example_contact_list_request_subscription_async ( - TpBaseContactList *contact_list, + TpMutableContactList *contact_list, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, @@ -1158,7 +1174,8 @@ example_contact_list_request_subscription_async ( g_free (message_lc); } - tp_base_contact_list_contacts_changed (contact_list, changed, NULL); + tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (contact_list), + changed, NULL); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_request_subscription_async); @@ -1166,7 +1183,7 @@ example_contact_list_request_subscription_async ( static void example_contact_list_authorize_publication_async ( - TpBaseContactList *contact_list, + TpMutableContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1205,7 +1222,8 @@ example_contact_list_authorize_publication_async ( } } - tp_base_contact_list_contacts_changed (contact_list, changed, NULL); + tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (contact_list), + changed, NULL); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_authorize_publication_async); @@ -1213,7 +1231,7 @@ example_contact_list_authorize_publication_async ( static void example_contact_list_store_contacts_async ( - TpBaseContactList *contact_list, + TpMutableContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1244,14 +1262,15 @@ example_contact_list_store_contacts_async ( } } - tp_base_contact_list_contacts_changed (contact_list, changed, NULL); + tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (contact_list), + changed, NULL); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_store_contacts_async); } static void -example_contact_list_remove_contacts_async (TpBaseContactList *contact_list, +example_contact_list_remove_contacts_async (TpMutableContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1291,14 +1310,15 @@ example_contact_list_remove_contacts_async (TpBaseContactList *contact_list, } } - tp_base_contact_list_contacts_changed (contact_list, NULL, removed); + tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (contact_list), + NULL, removed); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_remove_contacts_async); } static void -example_contact_list_unsubscribe_async (TpBaseContactList *contact_list, +example_contact_list_unsubscribe_async (TpMutableContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1355,14 +1375,15 @@ example_contact_list_unsubscribe_async (TpBaseContactList *contact_list, } } - tp_base_contact_list_contacts_changed (contact_list, changed, NULL); + tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (contact_list), + changed, NULL); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_unsubscribe_async); } static void -example_contact_list_unpublish_async (TpBaseContactList *contact_list, +example_contact_list_unpublish_async (TpMutableContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1433,14 +1454,15 @@ example_contact_list_unpublish_async (TpBaseContactList *contact_list, } } - tp_base_contact_list_contacts_changed (contact_list, changed, removed); + tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (contact_list), + changed, removed); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_unpublish_async); } static gboolean -example_contact_list_is_blocked (TpBaseContactList *contact_list, +example_contact_list_is_blocked (TpBlockableContactList *contact_list, TpHandle contact) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); @@ -1449,7 +1471,7 @@ example_contact_list_is_blocked (TpBaseContactList *contact_list, } static TpHandleSet * -example_contact_list_dup_blocked_contacts (TpBaseContactList *contact_list) +example_contact_list_dup_blocked_contacts (TpBlockableContactList *contact_list) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); @@ -1458,7 +1480,7 @@ example_contact_list_dup_blocked_contacts (TpBaseContactList *contact_list) static void example_contact_list_block_contacts_with_abuse_async ( - TpBaseContactList *contact_list, + TpBlockableContactList *contact_list, TpHandleSet *contacts, gboolean report_abusive, GAsyncReadyCallback callback, @@ -1482,14 +1504,15 @@ example_contact_list_block_contacts_with_abuse_async ( } } - tp_base_contact_list_contact_blocking_changed (contact_list, changed); + tp_blockable_contact_list_contact_blocking_changed (contact_list, changed); tp_handle_set_destroy (changed); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_block_contacts_with_abuse_async); } static void -example_contact_list_unblock_contacts_async (TpBaseContactList *contact_list, +example_contact_list_unblock_contacts_async ( + TpBlockableContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1511,7 +1534,7 @@ example_contact_list_unblock_contacts_async (TpBaseContactList *contact_list, } } - tp_base_contact_list_contact_blocking_changed (contact_list, changed); + tp_blockable_contact_list_contact_blocking_changed (contact_list, changed); tp_handle_set_destroy (changed); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_unblock_contacts_async); @@ -1519,13 +1542,13 @@ example_contact_list_unblock_contacts_async (TpBaseContactList *contact_list, static guint example_contact_list_get_group_storage ( - TpBaseContactList *contact_list G_GNUC_UNUSED) + TpMutableContactGroupList *contact_list G_GNUC_UNUSED) { return TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE; } static GStrv -example_contact_list_dup_groups (TpBaseContactList *contact_list) +example_contact_list_dup_groups (TpContactGroupList *contact_list) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); GPtrArray *tags = g_ptr_array_sized_new ( @@ -1543,10 +1566,10 @@ example_contact_list_dup_groups (TpBaseContactList *contact_list) } static GStrv -example_contact_list_dup_contact_groups (TpBaseContactList *contact_list, +example_contact_list_dup_contact_groups (TpContactGroupList *group_list, TpHandle contact) { - ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); + ExampleContactList *self = EXAMPLE_CONTACT_LIST (group_list); GPtrArray *tags = g_ptr_array_sized_new ( g_hash_table_size (self->priv->all_tags) + 1); ExampleContactDetails *d = lookup_contact (self, contact); @@ -1567,7 +1590,8 @@ example_contact_list_dup_contact_groups (TpBaseContactList *contact_list, } static void -example_contact_list_remove_group_async (TpBaseContactList *contact_list, +example_contact_list_remove_group_async ( + TpMutableContactGroupList *contact_list, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) @@ -1578,7 +1602,8 @@ example_contact_list_remove_group_async (TpBaseContactList *contact_list, /* signal the deletion */ g_message ("deleting group %s", group); - tp_base_contact_list_groups_removed (contact_list, &group, 1); + tp_contact_group_list_groups_removed (TP_CONTACT_GROUP_LIST (contact_list), + &group, 1); /* apply the change to our model of the contacts too; we don't need to signal * the change, because TpBaseContactList already did */ @@ -1598,7 +1623,7 @@ example_contact_list_remove_group_async (TpBaseContactList *contact_list, } static gchar * -example_contact_list_normalize_group (TpBaseContactList *contact_list, +example_contact_list_normalize_group (TpContactGroupList *contact_list, const gchar *id) { if (id[0] == '\0') @@ -1608,7 +1633,8 @@ example_contact_list_normalize_group (TpBaseContactList *contact_list, } static void -example_contact_list_rename_group_async (TpBaseContactList *contact_list, +example_contact_list_rename_group_async ( + TpMutableContactGroupList *contact_list, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, @@ -1621,7 +1647,8 @@ example_contact_list_rename_group_async (TpBaseContactList *contact_list, /* signal the rename */ g_print ("renaming group %s to %s", old_name, new_name); - tp_base_contact_list_group_renamed (contact_list, old_name, new_name); + tp_contact_group_list_group_renamed (TP_CONTACT_GROUP_LIST (contact_list), + old_name, new_name); /* update our model (this doesn't need to signal anything because * TpBaseContactList already did) */ @@ -1685,8 +1712,8 @@ example_contact_list_class_init (ExampleContactListClass *klass) static void mutable_contact_list_iface_init (TpMutableContactListInterface *iface) { - iface->can_change_contact_list = tp_base_contact_list_true_func; - iface->get_request_uses_message = tp_base_contact_list_true_func; + iface->can_change_contact_list = tp_mutable_contact_list_true_func; + iface->get_request_uses_message = tp_mutable_contact_list_true_func; iface->request_subscription_async = example_contact_list_request_subscription_async; iface->authorize_publication_async = @@ -1700,7 +1727,7 @@ mutable_contact_list_iface_init (TpMutableContactListInterface *iface) static void blockable_contact_list_iface_init (TpBlockableContactListInterface *iface) { - iface->can_block = tp_base_contact_list_true_func; + iface->can_block = tp_blockable_contact_list_true_func; iface->is_blocked = example_contact_list_is_blocked; iface->dup_blocked_contacts = example_contact_list_dup_blocked_contacts; iface->block_contacts_with_abuse_async = diff --git a/telepathy-farstream/call-stream.c b/telepathy-farstream/call-stream.c index 65d2d2ccb..86a3dfeab 100644 --- a/telepathy-farstream/call-stream.c +++ b/telepathy-farstream/call-stream.c @@ -331,7 +331,8 @@ _tf_call_stream_push_remote_candidates (TfCallStream *self, tf_call_stream_fail (self, TP_CALL_STATE_CHANGE_REASON_INTERNAL_ERROR, TP_ERROR_STR_MEDIA_STREAMING_ERROR, - "Error setting the remote candidates: %s", error->message); + "Error setting the remote candidates: %s", + error != NULL ? error->message : "invalid transport type"); g_clear_error (&error); } fs_candidate_list_destroy (fscandidates); @@ -1552,6 +1553,7 @@ cb_fs_component_state_changed (TfCallStream *stream, guint component, break; case FS_STREAM_STATE_CONNECTED: state = TP_STREAM_ENDPOINT_STATE_PROVISIONALLY_CONNECTED; + break; case FS_STREAM_STATE_READY: state = TP_STREAM_ENDPOINT_STATE_FULLY_CONNECTED; break; diff --git a/telepathy-glib/account-request.c b/telepathy-glib/account-request.c index 1e349fec7..dccaa3664 100644 --- a/telepathy-glib/account-request.c +++ b/telepathy-glib/account-request.c @@ -1349,13 +1349,9 @@ tp_account_request_create_account_async (TpAccountRequest *self, GAsyncReadyCallback callback, gpointer user_data) { - TpAccountRequestPrivate *priv = self->priv; - g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); - priv = self->priv; - - if (priv->result != NULL) + if (self->priv->result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, @@ -1365,7 +1361,7 @@ tp_account_request_create_account_async (TpAccountRequest *self, return; } - if (priv->created) + if (self->priv->created) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, @@ -1374,12 +1370,12 @@ tp_account_request_create_account_async (TpAccountRequest *self, return; } - priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, - tp_account_request_create_account_async); + self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, + user_data, tp_account_request_create_account_async); - tp_cli_account_manager_call_create_account (priv->account_manager, - -1, priv->cm_name, priv->proto_name, priv->display_name, - priv->parameters, priv->properties, + tp_cli_account_manager_call_create_account (self->priv->account_manager, + -1, self->priv->cm_name, self->priv->proto_name, self->priv->display_name, + self->priv->parameters, self->priv->properties, tp_account_request_create_account_cb, NULL, NULL, G_OBJECT (self)); } diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index 8fd7c55d8..cec883c76 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -395,8 +395,9 @@ tp_account_init (TpAccount *self) static void _tp_account_invalidated_cb (TpAccount *self, guint domain, - guint code, - gchar *message) + gint code, + gchar *message, + gpointer user_data) { TpAccountPrivate *priv = self->priv; @@ -3306,21 +3307,23 @@ tp_account_get_supersedes (TpAccount *self) static void _tp_account_got_avatar_cb (TpProxy *proxy, - const GValue *out_Value, + const GValue *value, const GError *error, gpointer user_data, GObject *weak_object) { GTask *task = user_data; + g_return_if_fail (error != NULL || value != NULL); + if (error != NULL) { DEBUG ("Failed to get avatar: %s", error->message); g_task_return_error (task, g_error_copy (error)); } - else if (!G_VALUE_HOLDS (out_Value, TP_STRUCT_TYPE_AVATAR)) + else if (!G_VALUE_HOLDS (value, TP_STRUCT_TYPE_AVATAR)) { - DEBUG ("Avatar had wrong type: %s", G_VALUE_TYPE_NAME (out_Value)); + DEBUG ("Avatar had wrong type: %s", G_VALUE_TYPE_NAME (value)); g_task_return_new_error (task, TP_ERROR, TP_ERROR_CONFUSED, "Incorrect type for Avatar property"); } @@ -3328,7 +3331,7 @@ _tp_account_got_avatar_cb (TpProxy *proxy, { /* we just put the GValueArray in the task, and use a non-trivial * finish function to split it into data and MIME type */ - g_task_return_pointer (task, g_value_dup_boxed (out_Value), + g_task_return_pointer (task, g_value_dup_boxed (value), (GDestroyNotify) tp_value_array_free); } diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c index e975b0acb..e9040e216 100644 --- a/telepathy-glib/base-client.c +++ b/telepathy-glib/base-client.c @@ -415,6 +415,7 @@ tp_base_client_add_observer_filter_variant (TpBaseClient *self, TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); + g_return_if_fail (cls != NULL); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->observe_channel != NULL); g_return_if_fail (g_variant_is_of_type (filter, G_VARIANT_TYPE_VARDICT)); @@ -456,6 +457,7 @@ tp_base_client_set_observer_recover (TpBaseClient *self, TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); + g_return_if_fail (cls != NULL); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->observe_channel != NULL); @@ -496,6 +498,7 @@ tp_base_client_set_observer_delay_approvers (TpBaseClient *self, TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); + g_return_if_fail (cls != NULL); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->observe_channel != NULL); @@ -589,6 +592,7 @@ tp_base_client_add_approver_filter_variant (TpBaseClient *self, TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); + g_return_if_fail (cls != NULL); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->add_dispatch_operation != NULL); g_return_if_fail (g_variant_is_of_type (filter, G_VARIANT_TYPE_VARDICT)); @@ -619,6 +623,7 @@ tp_base_client_be_a_handler (TpBaseClient *self) TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); + g_return_if_fail (cls != NULL); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channel != NULL); @@ -679,6 +684,7 @@ tp_base_client_add_handler_filter_variant (TpBaseClient *self, TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); + g_return_if_fail (cls != NULL); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channel != NULL); g_return_if_fail (g_variant_is_of_type (filter, G_VARIANT_TYPE_VARDICT)); @@ -736,6 +742,7 @@ tp_base_client_set_handler_bypass_approval (TpBaseClient *self, TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); + g_return_if_fail (cls != NULL); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channel != NULL); @@ -773,6 +780,7 @@ tp_base_client_set_handler_request_notification (TpBaseClient *self) TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); + g_return_if_fail (cls != NULL); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channel != NULL); @@ -819,6 +827,7 @@ tp_base_client_add_handler_capability (TpBaseClient *self, TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); + g_return_if_fail (cls != NULL); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channel != NULL); @@ -2319,7 +2328,7 @@ _tp_base_client_add_request (TpSvcClientInterfaceRequests *iface, { TpBaseClient *self = TP_BASE_CLIENT (iface); TpChannelRequest *request; - TpAccount *account; + TpAccount *account = NULL; GError *error = NULL; channel_request_prepare_account_ctx *ctx; GArray *account_features; diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c index 5d581850e..ad78d8c3f 100644 --- a/telepathy-glib/base-connection.c +++ b/telepathy-glib/base-connection.c @@ -1263,6 +1263,7 @@ tp_base_connection_register (TpBaseConnection *self, guint prefix_length; const guint dbus_max_name_length = 255; + g_return_val_if_fail (cls != NULL, FALSE); g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), FALSE); g_return_val_if_fail (cm_name != NULL, FALSE); g_return_val_if_fail (!self->priv->been_registered, FALSE); @@ -1421,6 +1422,7 @@ tp_base_connection_connect (_TpGDBusConnection *skeleton, GError *error = NULL; g_assert (TP_IS_BASE_CONNECTION (self)); + g_assert (cls != NULL); if (self->priv->status == TP_INTERNAL_CONNECTION_STATUS_NEW) { @@ -2743,6 +2745,7 @@ tp_base_connection_dup_contact_attributes (TpBaseConnection *self, TpHandle h; g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL); + g_return_val_if_fail (klass != NULL, NULL); g_return_val_if_fail (tp_base_connection_check_connected (self, NULL), NULL); g_return_val_if_fail (klass->fill_contact_attributes != NULL, NULL); diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c index d6286b483..6b1716eab 100644 --- a/telepathy-glib/base-contact-list.c +++ b/telepathy-glib/base-contact-list.c @@ -146,6 +146,23 @@ */ /** + * TpBlockableContactListDupContactsFunc: + * @self: the contact list manager implementing + * #TP_TYPE_BLOCKABLE_CONTACT_LIST + * + * Signature of a virtual method to list contacts with a particular state; + * the required state is defined by the particular virtual method being + * implemented. + * + * The implementation is expected to have a cache of contacts on the contact + * list, which is updated based on protocol events. + * + * Returns: (transfer full): a set of contacts with the desired state + * + * Since: UNRELEASED + */ + +/** * TpBaseContactListDupStatesFunc: * @self: the contact list manager * @contact: the contact @@ -178,8 +195,9 @@ */ /** - * TpBaseContactListActOnContactsFunc: - * @self: the contact list manager + * TpMutableContactListActOnContactsFunc: + * @self: the contact list manager implementing + * #TP_TYPE_BLOCKABLE_CONTACT_LIST * @contacts: the contacts on which to act * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback @@ -196,7 +214,22 @@ */ /** - * TpBaseContactListRequestSubscriptionFunc: + * TpBlockableContactListActOnContactsFunc: + * @self: the contact list manager + * @contacts: the contacts on which to act + * @callback: a callback to call on success, failure or disconnection + * @user_data: user data for the callback + * + * Signature of a virtual method that acts on a set of contacts and needs no + * additional information, such as removing contacts, approving or cancelling + * presence publication, cancelling presence subscription, or removing + * contacts. + * + * Since: UNRELEASED + */ + +/** + * TpMutableContactListRequestSubscriptionFunc: * @self: the contact list manager * @contacts: the contacts whose subscription is to be requested * @message: an optional human-readable message from the user @@ -225,6 +258,48 @@ * Since: 0.13.0 */ +/** + * TpMutableContactListAsyncFinishFunc: + * @self: the contact list manager implementing + * #TP_TYPE_MUTABLE_CONTACT_LIST + * @result: the result of the asynchronous operation + * @error: used to raise an error if %FALSE is returned + * + * Signature of a virtual method to finish an async operation. + * + * Returns: %TRUE on success, or %FALSE if @error is set + * + * Since: UNRELEASED + */ + +/** + * TpBlockableContactListAsyncFinishFunc: + * @self: the contact list manager implementing + * #TP_TYPE_BLOCKABLE_CONTACT_LIST + * @result: the result of the asynchronous operation + * @error: used to raise an error if %FALSE is returned + * + * Signature of a virtual method to finish an async operation. + * + * Returns: %TRUE on success, or %FALSE if @error is set + * + * Since: UNRELEASED + */ + +/** + * TpMutableContactGroupListAsyncFinishFunc: + * @self: the contact list manager implementing + * #TP_TYPE_MUTABLE_CONTACT_GROUP_LIST + * @result: the result of the asynchronous operation + * @error: used to raise an error if %FALSE is returned + * + * Signature of a virtual method to finish an async operation. + * + * Returns: %TRUE on success, or %FALSE if @error is set + * + * Since: UNRELEASED + */ + #include "config.h" #include <telepathy-glib/base-connection.h> @@ -293,35 +368,35 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseContactList, * TpMutableContactListInterface: * @parent: the parent interface * @request_subscription_async: the implementation of - * tp_base_contact_list_request_subscription_async(); must always be provided + * tp_mutable_contact_list_request_subscription_async(); must always be provided * @request_subscription_finish: the implementation of - * tp_base_contact_list_request_subscription_finish(); the default + * tp_mutable_contact_list_request_subscription_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @authorize_publication_async: the implementation of - * tp_base_contact_list_authorize_publication_async(); must always be provided + * tp_mutable_contact_list_authorize_publication_async(); must always be provided * @authorize_publication_finish: the implementation of - * tp_base_contact_list_authorize_publication_finish(); the default + * tp_mutable_contact_list_authorize_publication_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @remove_contacts_async: the implementation of - * tp_base_contact_list_remove_contacts_async(); must always be provided + * tp_mutable_contact_list_remove_contacts_async(); must always be provided * @remove_contacts_finish: the implementation of - * tp_base_contact_list_remove_contacts_finish(); the default + * tp_mutable_contact_list_remove_contacts_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @unsubscribe_async: the implementation of - * tp_base_contact_list_unsubscribe_async(); must always be provided + * tp_mutable_contact_list_unsubscribe_async(); must always be provided * @unsubscribe_finish: the implementation of - * tp_base_contact_list_unsubscribe_finish(); the default + * tp_mutable_contact_list_unsubscribe_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @unpublish_async: the implementation of - * tp_base_contact_list_unpublish_async(); must always be provided + * tp_mutable_contact_list_unpublish_async(); must always be provided * @unpublish_finish: the implementation of - * tp_base_contact_list_unpublish_finish(); the default + * tp_mutable_contact_list_unpublish_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @store_contacts_async: the implementation of - * tp_base_contact_list_store_contacts_async(); if not reimplemented, + * tp_mutable_contact_list_store_contacts_async(); if not reimplemented, * the default implementation is %NULL, which is interpreted as "do nothing" * @store_contacts_finish: the implementation of - * tp_base_contact_list_store_contacts_finish(); the default + * tp_mutable_contact_list_store_contacts_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @can_change_contact_list: the implementation of * tp_base_contact_list_can_change_contact_list(); if not reimplemented, @@ -335,6 +410,15 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseContactList, * Since: 0.13.0 */ +/** + * TpMutableContactList: + * + * Opaque structure representing an object implementing + * TpMutableContactListInterface. + * + * Since: UNRELEASED + */ + G_DEFINE_INTERFACE (TpMutableContactList, tp_mutable_contact_list, TP_TYPE_BASE_CONTACT_LIST) @@ -351,25 +435,25 @@ G_DEFINE_INTERFACE (TpMutableContactList, tp_mutable_contact_list, * TpBlockableContactListInterface: * @parent: the parent interface * @is_blocked: the implementation of - * tp_base_contact_list_is_blocked(); must always be provided + * tp_blockable_contact_list_is_blocked(); must always be provided * @dup_blocked_contacts: the implementation of - * tp_base_contact_list_dup_blocked_contacts(); must always be provided + * tp_blockable_contact_list_dup_blocked_contacts(); must always be provided * @block_contacts_async: the implementation of - * tp_base_contact_list_block_contacts_async(); either this or + * tp_blockable_contact_list_block_contacts_async(); either this or * @block_contacts_with_abuse_async must always be provided * @block_contacts_finish: the implementation of - * tp_base_contact_list_block_contacts_finish(); the default + * tp_blockable_contact_list_block_contacts_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @unblock_contacts_async: the implementation of - * tp_base_contact_list_unblock_contacts_async(); must always be provided + * tp_blockable_contact_list_unblock_contacts_async(); must always be provided * @unblock_contacts_finish: the implementation of - * tp_base_contact_list_unblock_contacts_finish(); the default + * tp_blockable_contact_list_unblock_contacts_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @can_block: the implementation of * tp_base_contact_list_can_block(); if not reimplemented, * the default implementation always returns %TRUE * @block_contacts_with_abuse_async: the implementation of - * tp_base_contact_list_block_contacts_async(); either this or + * tp_blockable_contact_list_block_contacts_async(); either this or * @block_contacts_async must always be provided. If the underlying protocol * does not support reporting contacts as abusive, implement * @block_contacts_async instead. Since: 0.15.1 @@ -379,6 +463,15 @@ G_DEFINE_INTERFACE (TpMutableContactList, tp_mutable_contact_list, * Since: 0.13.0 */ +/** + * TpBlockableContactList: + * + * Opaque structure representing an object implementing + * TpBlockableContactListInterface. + * + * Since: UNRELEASED + */ + G_DEFINE_INTERFACE (TpBlockableContactList, tp_blockable_contact_list, TP_TYPE_BASE_CONTACT_LIST) @@ -397,16 +490,16 @@ G_DEFINE_INTERFACE (TpBlockableContactList, tp_blockable_contact_list, * TpContactGroupListInterface: * @parent: the parent interface * @dup_groups: the implementation of - * tp_base_contact_list_dup_groups(); must always be implemented + * tp_contact_group_list_dup_groups(); must always be implemented * @dup_group_members: the implementation of - * tp_base_contact_list_dup_group_members(); must always be implemented + * tp_contact_group_list_dup_group_members(); must always be implemented * @dup_contact_groups: the implementation of - * tp_base_contact_list_dup_contact_groups(); must always be implemented + * tp_contact_group_list_dup_contact_groups(); must always be implemented * @has_disjoint_groups: the implementation of - * tp_base_contact_list_has_disjoint_groups(); if not reimplemented, + * tp_contact_group_list_has_disjoint_groups(); if not reimplemented, * the default implementation always returns %FALSE * @normalize_group: the implementation of - * tp_base_contact_list_normalize_group(); if not reimplemented, + * tp_contact_group_list_normalize_group(); if not reimplemented, * the default implementation is %NULL, which allows any UTF-8 string * as a group name (including the empty string) and assumes that any distinct * group names can coexist @@ -416,6 +509,15 @@ G_DEFINE_INTERFACE (TpBlockableContactList, tp_blockable_contact_list, * Since: 0.13.0 */ +/** + * TpContactGroupList: + * + * Opaque structure representing an object implementing + * TpContactGroupListInterface. + * + * Since: UNRELEASED + */ + G_DEFINE_INTERFACE (TpContactGroupList, tp_contact_group_list, TP_TYPE_BASE_CONTACT_LIST) @@ -437,36 +539,36 @@ G_DEFINE_INTERFACE (TpContactGroupList, tp_contact_group_list, * %NULL, which results in %TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE being * advertised * @set_contact_groups_async: the implementation of - * tp_base_contact_list_set_contact_groups_async(); must always be implemented + * tp_mutable_contact_group_list_set_contact_groups_async(); must always be implemented * @set_contact_groups_finish: the implementation of - * tp_base_contact_list_set_contact_groups_finish(); the default + * tp_mutable_contact_group_list_set_contact_groups_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @set_group_members_async: the implementation of - * tp_base_contact_list_set_group_members_async(); must always be implemented + * tp_mutable_contact_group_list_set_group_members_async(); must always be implemented * @set_group_members_finish: the implementation of - * tp_base_contact_list_set_group_members_finish(); the default + * tp_mutable_contact_group_list_set_group_members_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @add_to_group_async: the implementation of - * tp_base_contact_list_add_to_group_async(); must always be implemented + * tp_mutable_contact_group_list_add_to_group_async(); must always be implemented * @add_to_group_finish: the implementation of - * tp_base_contact_list_add_to_group_finish(); the default + * tp_mutable_contact_group_list_add_to_group_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @remove_from_group_async: the implementation of - * tp_base_contact_list_remove_from_group_async(); must always be implemented + * tp_mutable_contact_group_list_remove_from_group_async(); must always be implemented * @remove_from_group_finish: the implementation of - * tp_base_contact_list_remove_from_group_finish(); the default + * tp_mutable_contact_group_list_remove_from_group_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @remove_group_async: the implementation of - * tp_base_contact_list_remove_group_async(); must always be implemented + * tp_mutable_contact_group_list_remove_group_async(); must always be implemented * @remove_group_finish: the implementation of - * tp_base_contact_list_remove_group_finish(); the default + * tp_mutable_contact_group_list_remove_group_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @rename_group_async: the implementation of - * tp_base_contact_list_rename_group_async(); the default implementation + * tp_mutable_contact_group_list_rename_group_async(); the default implementation * results in group renaming being emulated via a call to * @add_to_group_async and a call to @remove_group_async * @rename_group_finish: the implementation of - * tp_base_contact_list_rename_group_finish(); the default + * tp_mutable_contact_group_list_rename_group_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * * The interface vtable for a %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST. @@ -474,6 +576,15 @@ G_DEFINE_INTERFACE (TpContactGroupList, tp_contact_group_list, * Since: 0.13.0 */ +/** + * TpMutableContactGroupList: + * + * Opaque structure representing an object implementing + * TpMutableContactGroupListInterface. + * + * Since: UNRELEASED + */ + G_DEFINE_INTERFACE (TpMutableContactGroupList, tp_mutable_contact_group_list, TP_TYPE_CONTACT_GROUP_LIST) @@ -626,12 +737,16 @@ update_immutable_contact_list_properties (TpBaseContactList *self) static void update_immutable_contact_groups_properties (TpBaseContactList *self) { + TpContactGroupList *contact_group; + if (self->priv->contact_groups_skeleton == NULL) return; + contact_group = TP_CONTACT_GROUP_LIST (self); + _tp_gdbus_connection_interface_contact_groups1_set_disjoint_groups ( self->priv->contact_groups_skeleton, - tp_base_contact_list_has_disjoint_groups (self)); + tp_contact_group_list_has_disjoint_groups (contact_group)); _tp_gdbus_connection_interface_contact_groups1_set_group_storage ( self->priv->contact_groups_skeleton, @@ -787,40 +902,80 @@ tp_base_contact_list_download_async_default (TpBaseContactList *self, "This CM does not implement Download"); } +static gboolean +tp_mutable_contact_list_simple_finish (TpMutableContactList *self, + GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple = (GSimpleAsyncResult *) result; + + g_return_val_if_fail (g_simple_async_result_is_valid ( + result, G_OBJECT (self), NULL), FALSE); + + return !g_simple_async_result_propagate_error (simple, error); +} + static void tp_mutable_contact_list_default_init (TpMutableContactListInterface *iface) { - iface->request_subscription_finish = tp_base_contact_list_simple_finish; - iface->authorize_publication_finish = tp_base_contact_list_simple_finish; - iface->unsubscribe_finish = tp_base_contact_list_simple_finish; - iface->unpublish_finish = tp_base_contact_list_simple_finish; - iface->store_contacts_finish = tp_base_contact_list_simple_finish; - iface->remove_contacts_finish = tp_base_contact_list_simple_finish; + iface->request_subscription_finish = tp_mutable_contact_list_simple_finish; + iface->authorize_publication_finish = tp_mutable_contact_list_simple_finish; + iface->unsubscribe_finish = tp_mutable_contact_list_simple_finish; + iface->unpublish_finish = tp_mutable_contact_list_simple_finish; + iface->store_contacts_finish = tp_mutable_contact_list_simple_finish; + iface->remove_contacts_finish = tp_mutable_contact_list_simple_finish; - iface->can_change_contact_list = tp_base_contact_list_true_func; - iface->get_request_uses_message = tp_base_contact_list_true_func; + iface->can_change_contact_list = tp_mutable_contact_list_true_func; + iface->get_request_uses_message = tp_mutable_contact_list_true_func; /* there's no default for the other virtual methods */ } +static gboolean +tp_blockable_contact_list_simple_finish (TpBlockableContactList *self, + GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple = (GSimpleAsyncResult *) result; + + g_return_val_if_fail (g_simple_async_result_is_valid ( + result, G_OBJECT (self), NULL), FALSE); + + return !g_simple_async_result_propagate_error (simple, error); +} + static void tp_blockable_contact_list_default_init (TpBlockableContactListInterface *iface) { - iface->block_contacts_finish = tp_base_contact_list_simple_finish; - iface->unblock_contacts_finish = tp_base_contact_list_simple_finish; + iface->block_contacts_finish = tp_blockable_contact_list_simple_finish; + iface->unblock_contacts_finish = tp_blockable_contact_list_simple_finish; - iface->can_block = tp_base_contact_list_true_func; + iface->can_block = tp_blockable_contact_list_true_func; /* there's no default for the other virtual methods */ } static void tp_contact_group_list_default_init (TpContactGroupListInterface *iface) { - iface->has_disjoint_groups = tp_base_contact_list_false_func; + iface->has_disjoint_groups = tp_contact_group_list_false_func; /* there's no default for the other virtual methods */ } -static void tp_base_contact_list_emulate_rename_group (TpBaseContactList *, - const gchar *, const gchar *, GAsyncReadyCallback, gpointer); +static void tp_base_contact_list_emulate_rename_group ( + TpMutableContactGroupList *, const gchar *, const gchar *, + GAsyncReadyCallback, gpointer); + +static gboolean +tp_mutable_contact_group_list_simple_finish (TpMutableContactGroupList *self, + GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple = (GSimpleAsyncResult *) result; + + g_return_val_if_fail (g_simple_async_result_is_valid ( + result, G_OBJECT (self), NULL), FALSE); + + return !g_simple_async_result_propagate_error (simple, error); +} static void tp_mutable_contact_group_list_default_init ( @@ -828,12 +983,12 @@ tp_mutable_contact_group_list_default_init ( { iface->rename_group_async = tp_base_contact_list_emulate_rename_group; - iface->add_to_group_finish = tp_base_contact_list_simple_finish; - iface->remove_from_group_finish = tp_base_contact_list_simple_finish; - iface->set_contact_groups_finish = tp_base_contact_list_simple_finish; - iface->remove_group_finish = tp_base_contact_list_simple_finish; - iface->rename_group_finish = tp_base_contact_list_simple_finish; - iface->set_group_members_finish = tp_base_contact_list_simple_finish; + iface->add_to_group_finish = tp_mutable_contact_group_list_simple_finish; + iface->remove_from_group_finish = tp_mutable_contact_group_list_simple_finish; + iface->set_contact_groups_finish = tp_mutable_contact_group_list_simple_finish; + iface->remove_group_finish = tp_mutable_contact_group_list_simple_finish; + iface->rename_group_finish = tp_mutable_contact_group_list_simple_finish; + iface->set_group_members_finish = tp_mutable_contact_group_list_simple_finish; } static void @@ -969,7 +1124,7 @@ tp_base_contact_list_set_list_failed (TpBaseContactList *self, * #TpBaseContactListDupStatesFunc must already give correct * results when entering this method. * - * If implemented, tp_base_contact_list_dup_blocked_contacts() must also + * If implemented, tp_blockable_contact_list_dup_blocked_contacts() must also * give correct results when entering this method. * * Since: 0.13.0 @@ -1010,9 +1165,10 @@ tp_base_contact_list_set_list_received (TpBaseContactList *self) if (tp_base_contact_list_can_block (self)) { + TpBlockableContactList *blockable = TP_BLOCKABLE_CONTACT_LIST (self); TpHandleSet *blocked; - blocked = tp_base_contact_list_dup_blocked_contacts (self); + blocked = tp_blockable_contact_list_dup_blocked_contacts (blockable); if (DEBUGGING) { @@ -1022,7 +1178,7 @@ tp_base_contact_list_set_list_received (TpBaseContactList *self) g_free (tmp); } - tp_base_contact_list_contact_blocking_changed (self, blocked); + tp_blockable_contact_list_contact_blocking_changed (blockable, blocked); if (self->priv->contact_blocking_skeleton != NULL && self->priv->blocked_contact_requests.length > 0) @@ -1047,17 +1203,18 @@ tp_base_contact_list_set_list_received (TpBaseContactList *self) * to emit one signal per group - that's probably fewer. */ if (TP_IS_CONTACT_GROUP_LIST (self)) { - GStrv groups = tp_base_contact_list_dup_groups (self); + TpContactGroupList *contact_group = TP_CONTACT_GROUP_LIST (self); + GStrv groups = tp_contact_group_list_dup_groups (contact_group); - tp_base_contact_list_groups_created (self, + tp_contact_group_list_groups_created (contact_group, (const gchar * const *) groups, -1); for (i = 0; groups != NULL && groups[i] != NULL; i++) { - TpHandleSet *members = tp_base_contact_list_dup_group_members (self, - groups[i]); + TpHandleSet *members = tp_contact_group_list_dup_group_members ( + contact_group, groups[i]); - tp_base_contact_list_groups_changed (self, members, + tp_contact_group_list_groups_changed (contact_group, members, (const gchar * const *) groups + i, 1, NULL, 0); tp_handle_set_destroy (members); } @@ -1268,13 +1425,13 @@ tp_base_contact_list_one_contact_removed (TpBaseContactList *self, } /** - * tp_base_contact_list_contact_blocking_changed: + * tp_blockable_contact_list_contact_blocking_changed: * @self: the contact list manager * @changed: a set of contacts who were blocked or unblocked * * Emit signals for a change to the blocked contacts list. * - * tp_base_contact_list_dup_blocked_contacts() + * tp_blockable_contact_list_dup_blocked_contacts() * must already reflect the contacts' new statuses when entering this method * (in practice, this means that implementations must update their own cache * of contacts before calling this method). @@ -1285,17 +1442,21 @@ tp_base_contact_list_one_contact_removed (TpBaseContactList *self, * Since: 0.13.0 */ void -tp_base_contact_list_contact_blocking_changed (TpBaseContactList *self, +tp_blockable_contact_list_contact_blocking_changed ( + TpBlockableContactList *blockable, TpHandleSet *changed) { + TpBaseContactList *self; TpHandleSet *now_blocked; GVariantBuilder blocked_contacts, unblocked_contacts; TpIntsetFastIter iter; TpHandle handle; - g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); + g_return_if_fail (TP_IS_BASE_CONTACT_LIST (blockable)); g_return_if_fail (changed != NULL); + self = (TpBaseContactList *) blockable; + /* don't do anything if we're disconnecting, or if we haven't had the * initial contact list yet */ if (tp_base_contact_list_get_state (self, NULL) != @@ -1306,7 +1467,7 @@ tp_base_contact_list_contact_blocking_changed (TpBaseContactList *self, g_return_if_fail (tp_base_contact_list_can_block (self)); - now_blocked = tp_base_contact_list_dup_blocked_contacts (self); + now_blocked = tp_blockable_contact_list_dup_blocked_contacts (blockable); g_variant_builder_init (&blocked_contacts, G_VARIANT_TYPE ("a{us}")); g_variant_builder_init (&unblocked_contacts, G_VARIANT_TYPE ("a{us}")); @@ -1366,7 +1527,7 @@ tp_base_contact_list_dup_contacts (TpBaseContactList *self) } /** - * tp_base_contact_list_request_subscription_async: + * tp_mutable_contact_list_request_subscription_async: * @self: a contact list manager * @contacts: the contacts whose subscription is to be requested * @message: an optional human-readable message from the user @@ -1392,7 +1553,7 @@ tp_base_contact_list_dup_contacts (TpBaseContactList *self) * Since: 0.13.0 */ void -tp_base_contact_list_request_subscription_async (TpBaseContactList *self, +tp_mutable_contact_list_request_subscription_async (TpMutableContactList *self, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, @@ -1404,19 +1565,18 @@ tp_base_contact_list_request_subscription_async (TpBaseContactList *self, g_return_if_fail (mutable_iface != NULL); g_return_if_fail (mutable_iface->request_subscription_async != NULL); - mutable_iface->request_subscription_async (self, contacts, message, callback, - user_data); + mutable_iface->request_subscription_async (self, contacts, message, callback, user_data); } /** - * tp_base_contact_list_request_subscription_finish: + * tp_mutable_contact_list_request_subscription_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_request_subscription_async() + * tp_mutable_contact_list_request_subscription_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_request_subscription_async(). + * tp_mutable_contact_list_request_subscription_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. @@ -1431,7 +1591,7 @@ tp_base_contact_list_request_subscription_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_request_subscription_finish (TpBaseContactList *self, +tp_mutable_contact_list_request_subscription_finish (TpMutableContactList *self, GAsyncResult *result, GError **error) { @@ -1489,7 +1649,7 @@ tp_base_contact_list_dup_states (TpBaseContactList *self, } /** - * tp_base_contact_list_authorize_publication_async: + * tp_mutable_contact_list_authorize_publication_async: * @self: a contact list manager * @contacts: the contacts to whom presence will be published * @callback: a callback to call when the authorization succeeds or fails @@ -1509,7 +1669,7 @@ tp_base_contact_list_dup_states (TpBaseContactList *self, * Since: 0.13.0 */ void -tp_base_contact_list_authorize_publication_async (TpBaseContactList *self, +tp_mutable_contact_list_authorize_publication_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1525,14 +1685,14 @@ tp_base_contact_list_authorize_publication_async (TpBaseContactList *self, } /** - * tp_base_contact_list_authorize_publication_finish: + * tp_mutable_contact_list_authorize_publication_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_authorize_publication_async() + * tp_mutable_contact_list_authorize_publication_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_authorize_publication_async(). + * tp_mutable_contact_list_authorize_publication_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. @@ -1547,7 +1707,7 @@ tp_base_contact_list_authorize_publication_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_authorize_publication_finish (TpBaseContactList *self, +tp_mutable_contact_list_authorize_publication_finish (TpMutableContactList *self, GAsyncResult *result, GError **error) { @@ -1562,7 +1722,7 @@ tp_base_contact_list_authorize_publication_finish (TpBaseContactList *self, } /** - * tp_base_contact_list_store_contacts_async: + * tp_mutable_contact_list_store_contacts_async: * @self: a contact list manager * @contacts: the contacts to be stored * @callback: a callback to call when the operation succeeds or fails @@ -1588,7 +1748,7 @@ tp_base_contact_list_authorize_publication_finish (TpBaseContactList *self, * Since: 0.13.0 */ void -tp_base_contact_list_store_contacts_async (TpBaseContactList *self, +tp_mutable_contact_list_store_contacts_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1602,19 +1762,18 @@ tp_base_contact_list_store_contacts_async (TpBaseContactList *self, tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, NULL); else - mutable_iface->store_contacts_async (self, contacts, callback, - user_data); + mutable_iface->store_contacts_async (self, contacts, callback, user_data); } /** - * tp_base_contact_list_store_contacts_finish: + * tp_mutable_contact_list_store_contacts_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_store_contacts_async() + * tp_mutable_contact_list_store_contacts_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_store_contacts_async(). + * tp_mutable_contact_list_store_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. @@ -1629,7 +1788,7 @@ tp_base_contact_list_store_contacts_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_store_contacts_finish (TpBaseContactList *self, +tp_mutable_contact_list_store_contacts_finish (TpMutableContactList *self, GAsyncResult *result, GError **error) { @@ -1643,16 +1802,16 @@ tp_base_contact_list_store_contacts_finish (TpBaseContactList *self, } /** - * tp_base_contact_list_remove_contacts_async: + * tp_mutable_contact_list_remove_contacts_async: * @self: a contact list manager * @contacts: the contacts to be removed * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * * Remove @contacts from the contact list entirely; this includes the - * effect of both tp_base_contact_list_unsubscribe_async() and - * tp_base_contact_list_unpublish_async(), and also reverses the effect of - * tp_base_contact_list_store_contacts_async(). + * effect of both tp_mutable_contact_list_unsubscribe_async() and + * tp_mutable_contact_list_unpublish_async(), and also reverses the effect of + * tp_mutable_contact_list_store_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, this method does nothing. @@ -1666,7 +1825,7 @@ tp_base_contact_list_store_contacts_finish (TpBaseContactList *self, * Since: 0.13.0 */ void -tp_base_contact_list_remove_contacts_async (TpBaseContactList *self, +tp_mutable_contact_list_remove_contacts_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1681,14 +1840,14 @@ tp_base_contact_list_remove_contacts_async (TpBaseContactList *self, } /** - * tp_base_contact_list_remove_contacts_finish: + * tp_mutable_contact_list_remove_contacts_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_remove_contacts_async() + * tp_mutable_contact_list_remove_contacts_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_remove_contacts_async(). + * tp_mutable_contact_list_remove_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. @@ -1703,7 +1862,7 @@ tp_base_contact_list_remove_contacts_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_remove_contacts_finish (TpBaseContactList *self, +tp_mutable_contact_list_remove_contacts_finish (TpMutableContactList *self, GAsyncResult *result, GError **error) { @@ -1717,7 +1876,7 @@ tp_base_contact_list_remove_contacts_finish (TpBaseContactList *self, } /** - * tp_base_contact_list_unsubscribe_async: + * tp_mutable_contact_list_unsubscribe_async: * @self: a contact list manager * @contacts: the contacts whose presence will no longer be received * @callback: a callback to call when the operation succeeds or fails @@ -1738,7 +1897,7 @@ tp_base_contact_list_remove_contacts_finish (TpBaseContactList *self, * Since: 0.13.0 */ void -tp_base_contact_list_unsubscribe_async (TpBaseContactList *self, +tp_mutable_contact_list_unsubscribe_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1753,14 +1912,14 @@ tp_base_contact_list_unsubscribe_async (TpBaseContactList *self, } /** - * tp_base_contact_list_unsubscribe_finish: + * tp_mutable_contact_list_unsubscribe_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_unsubscribe_async() + * tp_mutable_contact_list_unsubscribe_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_unsubscribe_async(). + * tp_mutable_contact_list_unsubscribe_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. @@ -1775,7 +1934,7 @@ tp_base_contact_list_unsubscribe_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_unsubscribe_finish (TpBaseContactList *self, +tp_mutable_contact_list_unsubscribe_finish (TpMutableContactList *self, GAsyncResult *result, GError **error) { @@ -1789,7 +1948,7 @@ tp_base_contact_list_unsubscribe_finish (TpBaseContactList *self, } /** - * tp_base_contact_list_unpublish_async: + * tp_mutable_contact_list_unpublish_async: * @self: a contact list manager * @contacts: the contacts to whom presence will no longer be published * @callback: a callback to call when the operation succeeds or fails @@ -1810,7 +1969,7 @@ tp_base_contact_list_unsubscribe_finish (TpBaseContactList *self, * Since: 0.13.0 */ void -tp_base_contact_list_unpublish_async (TpBaseContactList *self, +tp_mutable_contact_list_unpublish_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -1825,14 +1984,14 @@ tp_base_contact_list_unpublish_async (TpBaseContactList *self, } /** - * tp_base_contact_list_unpublish_finish: + * tp_mutable_contact_list_unpublish_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_unpublish_async() + * tp_mutable_contact_list_unpublish_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_unpublish_async(). + * tp_mutable_contact_list_unpublish_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. @@ -1847,7 +2006,7 @@ tp_base_contact_list_unpublish_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_unpublish_finish (TpBaseContactList *self, +tp_mutable_contact_list_unpublish_finish (TpMutableContactList *self, GAsyncResult *result, GError **error) { @@ -1876,6 +2035,40 @@ tp_base_contact_list_unpublish_finish (TpBaseContactList *self, */ /** + * TpBlockableContactListBooleanFunc: + * @self: a contact list manager implementing + * #TP_TYPE_BLOCKABLE_CONTACT_LIST + * + * Signature of a virtual method that returns a boolean result. These are used + * for feature-discovery. + * + * For the simple cases of a constant result, use + * tp_blockable_contact_list_true_func() or + * tp_blockable_contact_list_false_func(). + * + * Returns: a boolean result + * + * Since: UNRELEASED + */ + +/** + * TpMutableContactListBooleanFunc: + * @self: a contact list manager implementing + * #TP_TYPE_MUTABLE_CONTACT_LIST + * + * Signature of a virtual method that returns a boolean result. These are used + * for feature-discovery. + * + * For the simple cases of a constant result, use + * tp_mutable_contact_list_true_func() or + * tp_mutable_contact_list_false_func(). + * + * Returns: a boolean result + * + * Since: UNRELEASED + */ + +/** * tp_base_contact_list_true_func: * @self: ignored * @@ -1910,6 +2103,75 @@ tp_base_contact_list_false_func (TpBaseContactList *self G_GNUC_UNUSED) } /** + * tp_blockable_contact_list_true_func: + * @self: ignored + * + * An implementation of #TpBlockableContactListBooleanFunc that returns %TRUE, + * for use in simple cases. + * + * Returns: %TRUE + * + * Since: UNRELEASED + */ +gboolean +tp_blockable_contact_list_true_func (TpBlockableContactList *self G_GNUC_UNUSED) +{ + return TRUE; +} + +/** + * tp_blockable_contact_list_false_func: + * @self: ignored + * + * An implementation of #TpBlockableContactListBooleanFunc that returns %FALSE, + * for use in simple cases. + * + * Returns: %FALSE + * + * Since: 0.13.0 + */ +gboolean +tp_blockable_contact_list_false_func ( + TpBlockableContactList *self G_GNUC_UNUSED) +{ + return FALSE; +} + +/** + * tp_mutable_contact_list_true_func: + * @self: ignored + * + * An implementation of #TpMutableContactListBooleanFunc that returns %TRUE, + * for use in simple cases. + * + * Returns: %TRUE + * + * Since: UNRELEASED + */ +gboolean +tp_mutable_contact_list_true_func (TpMutableContactList *self G_GNUC_UNUSED) +{ + return TRUE; +} + +/** + * tp_mutable_contact_list_false_func: + * @self: ignored + * + * An implementation of #TpMutableContactListBooleanFunc that returns %FALSE, + * for use in simple cases. + * + * Returns: %TRUE + * + * Since: UNRELEASED + */ +gboolean +tp_mutable_contact_list_false_func (TpMutableContactList *self G_GNUC_UNUSED) +{ + return TRUE; +} + +/** * tp_base_contact_list_can_change_contact_list: * @self: a contact list manager * @@ -1952,7 +2214,7 @@ tp_base_contact_list_can_change_contact_list (TpBaseContactList *self) g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->can_change_contact_list != NULL, FALSE); - return iface->can_change_contact_list (self); + return iface->can_change_contact_list (TP_MUTABLE_CONTACT_LIST (self)); } /** @@ -2070,7 +2332,7 @@ tp_base_contact_list_download_finish (TpBaseContactList *self, * tp_base_contact_list_get_request_uses_message: * @self: a contact list manager * - * Return whether the tp_base_contact_list_request_subscription_async() + * Return whether the tp_mutable_contact_list_request_subscription_async() * method's @message argument is actually used. * * If the #TpBaseContactList subclass does not implement @@ -2084,7 +2346,7 @@ tp_base_contact_list_download_finish (TpBaseContactList *self, * protocols; subclasses may reimplement this method with * tp_base_contact_list_false_func() or a custom implementation if desired. * - * Returns: %TRUE if tp_base_contact_list_request_subscription_async() will not + * Returns: %TRUE if tp_mutable_contact_list_request_subscription_async() will not * ignore its @message argument * * Since: 0.13.0 @@ -2103,11 +2365,11 @@ tp_base_contact_list_get_request_uses_message (TpBaseContactList *self) g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->get_request_uses_message != NULL, FALSE); - return iface->get_request_uses_message (self); + return iface->get_request_uses_message (TP_MUTABLE_CONTACT_LIST (self)); } /** - * TpBaseContactListBlockContactsWithAbuseFunc: + * TpBlockableContactListBlockContactsWithAbuseFunc: * @self: the contact list manager * @contacts: the contacts to block * @report_abusive: whether to report the contacts as abusive to the server @@ -2118,7 +2380,7 @@ tp_base_contact_list_get_request_uses_message (TpBaseContactList *self) * Signature of a virtual method that blocks a set of contacts, optionally * reporting them to the server operator as abusive. * - * Since: 0.15.1 + * Since: UNRELEASED */ /** @@ -2163,11 +2425,11 @@ tp_base_contact_list_can_block (TpBaseContactList *self) g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->can_block != NULL, FALSE); - return iface->can_block (self); + return iface->can_block (TP_BLOCKABLE_CONTACT_LIST (self)); } /** - * tp_base_contact_list_is_blocked: + * tp_blockable_contact_list_is_blocked: * @self: a contact list manager * @contact: a contact * @@ -2182,16 +2444,16 @@ tp_base_contact_list_can_block (TpBaseContactList *self) * It must always be implemented. * * The result of this method must always be consistent with the result - * of tp_base_contact_list_dup_blocked_contacts(). It can usually + * of tp_blockable_contact_list_dup_blocked_contacts(). It can usually * use a more efficient implementation that does not require copying * a handle-set. * * Returns: %TRUE if @contact would be in - * tp_base_contact_list_dup_blocked_contacts() + * tp_blockable_contact_list_dup_blocked_contacts() * Since: 0.99.6 */ gboolean -tp_base_contact_list_is_blocked (TpBaseContactList *self, +tp_blockable_contact_list_is_blocked (TpBlockableContactList *self, TpHandle contact) { TpBlockableContactListInterface *iface = @@ -2199,14 +2461,15 @@ tp_base_contact_list_is_blocked (TpBaseContactList *self, g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->is_blocked != NULL, FALSE); - g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == - TP_CONTACT_LIST_STATE_SUCCESS, FALSE); + g_return_val_if_fail (tp_base_contact_list_get_state ( + TP_BASE_CONTACT_LIST (self), NULL) == TP_CONTACT_LIST_STATE_SUCCESS, + FALSE); return iface->is_blocked (self, contact); } /** - * tp_base_contact_list_dup_blocked_contacts: + * tp_blockable_contact_list_dup_blocked_contacts: * @self: a contact list manager * * Return the list of blocked contacts. It is incorrect to call this method @@ -2224,21 +2487,22 @@ tp_base_contact_list_is_blocked (TpBaseContactList *self, * Since: 0.13.0 */ TpHandleSet * -tp_base_contact_list_dup_blocked_contacts (TpBaseContactList *self) +tp_blockable_contact_list_dup_blocked_contacts (TpBlockableContactList *self) { TpBlockableContactListInterface *iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->dup_blocked_contacts != NULL, NULL); - g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == - TP_CONTACT_LIST_STATE_SUCCESS, NULL); + g_return_val_if_fail (tp_base_contact_list_get_state ( + TP_BASE_CONTACT_LIST (self), NULL) == TP_CONTACT_LIST_STATE_SUCCESS, + NULL); return iface->dup_blocked_contacts (self); } /** - * tp_base_contact_list_block_contacts_async: + * tp_blockable_contact_list_block_contacts_async: * @self: a contact list manager * @contacts: contacts whose communications should be blocked * @callback: a callback to call when the operation succeeds or fails @@ -2247,7 +2511,7 @@ tp_base_contact_list_dup_blocked_contacts (TpBaseContactList *self) * Request that the given contacts are prevented from communicating with the * user, and that presence is not sent to them even if they have a valid * presence subscription, if possible. This is equivalent to calling - * tp_base_contact_list_block_contacts_with_abuse_async(), passing #FALSE as + * tp_blockable_contact_list_block_contacts_with_abuse_async(), passing #FALSE as * the report_abusive argument. * * If the #TpBaseContactList subclass does not implement @@ -2258,23 +2522,23 @@ tp_base_contact_list_dup_blocked_contacts (TpBaseContactList *self) * #TpBlockableContactListInterface.block_contacts_async or * #TpBlockableContactListInterface.block_contacts_with_abuse_async. * The implementation should call - * tp_base_contact_list_contact_blocking_changed() + * tp_blockable_contact_list_contact_blocking_changed() * for any contacts it has changed, before calling @callback. * * Since: 0.13.0 */ void -tp_base_contact_list_block_contacts_async (TpBaseContactList *self, +tp_blockable_contact_list_block_contacts_async (TpBlockableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { - tp_base_contact_list_block_contacts_with_abuse_async (self, contacts, FALSE, + tp_blockable_contact_list_block_contacts_with_abuse_async (self, contacts, FALSE, callback, user_data); } /** - * tp_base_contact_list_block_contacts_with_abuse_async: + * tp_blockable_contact_list_block_contacts_with_abuse_async: * @self: a contact list manager * @contacts: contacts whose communications should be blocked * @report_abusive: whether to report the contacts as abusive to the server @@ -2297,13 +2561,14 @@ tp_base_contact_list_block_contacts_async (TpBaseContactList *self, * #TpBlockableContactListInterface.block_contacts_async or * #TpBlockableContactListInterface.block_contacts_with_abuse_async. * The implementation should call - * tp_base_contact_list_contact_blocking_changed() + * tp_blockable_contact_list_contact_blocking_changed() * for any contacts it has changed, before calling @callback. * * Since: 0.15.1 */ void -tp_base_contact_list_block_contacts_with_abuse_async (TpBaseContactList *self, +tp_blockable_contact_list_block_contacts_with_abuse_async ( + TpBlockableContactList *self, TpHandleSet *contacts, gboolean report_abusive, GAsyncReadyCallback callback, @@ -2325,14 +2590,14 @@ tp_base_contact_list_block_contacts_with_abuse_async (TpBaseContactList *self, } /** - * tp_base_contact_list_block_contacts_finish: + * tp_blockable_contact_list_block_contacts_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_block_contacts_async() + * tp_blockable_contact_list_block_contacts_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_block_contacts_async(). + * tp_blockable_contact_list_block_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method. @@ -2347,7 +2612,7 @@ tp_base_contact_list_block_contacts_with_abuse_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_block_contacts_finish (TpBaseContactList *self, +tp_blockable_contact_list_block_contacts_finish (TpBlockableContactList *self, GAsyncResult *result, GError **error) { @@ -2357,18 +2622,19 @@ tp_base_contact_list_block_contacts_finish (TpBaseContactList *self, g_return_val_if_fail (blockable_iface != NULL, FALSE); g_return_val_if_fail (blockable_iface->block_contacts_finish != NULL, FALSE); - return blockable_iface->block_contacts_finish (self, result, error); + return blockable_iface->block_contacts_finish ( + self, result, error); } /** - * tp_base_contact_list_block_contacts_with_abuse_finish: + * tp_blockable_contact_list_block_contacts_with_abuse_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_block_contacts_with_abuse_async() + * tp_blockable_contact_list_block_contacts_with_abuse_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_block_contacts_with_abuse_async(). + * tp_blockable_contact_list_block_contacts_with_abuse_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method. @@ -2383,7 +2649,8 @@ tp_base_contact_list_block_contacts_finish (TpBaseContactList *self, * Since: 0.15.1 */ gboolean -tp_base_contact_list_block_contacts_with_abuse_finish (TpBaseContactList *self, +tp_blockable_contact_list_block_contacts_with_abuse_finish ( + TpBlockableContactList *self, GAsyncResult *result, GError **error) { @@ -2393,17 +2660,18 @@ tp_base_contact_list_block_contacts_with_abuse_finish (TpBaseContactList *self, g_return_val_if_fail (blockable_iface != NULL, FALSE); g_return_val_if_fail (blockable_iface->block_contacts_finish != NULL, FALSE); - return blockable_iface->block_contacts_finish (self, result, error); + return blockable_iface->block_contacts_finish ( + self, result, error); } /** - * tp_base_contact_list_unblock_contacts_async: + * tp_blockable_contact_list_unblock_contacts_async: * @self: a contact list manager * @contacts: contacts whose communications should no longer be blocked * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * - * Reverse the effects of tp_base_contact_list_block_contacts_async(). + * Reverse the effects of tp_blockable_contact_list_block_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, this method does nothing. @@ -2412,13 +2680,13 @@ tp_base_contact_list_block_contacts_with_abuse_finish (TpBaseContactList *self, * method which must be implemented, using * #TpBlockableContactListInterface.unblock_contacts_async. * The implementation should call - * tp_base_contact_list_contact_blocking_changed() + * tp_blockable_contact_list_contact_blocking_changed() * for any contacts it has changed, before calling @callback. * * Since: 0.13.0 */ void -tp_base_contact_list_unblock_contacts_async (TpBaseContactList *self, +tp_blockable_contact_list_unblock_contacts_async (TpBlockableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -2433,14 +2701,14 @@ tp_base_contact_list_unblock_contacts_async (TpBaseContactList *self, } /** - * tp_base_contact_list_unblock_contacts_finish: + * tp_blockable_contact_list_unblock_contacts_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_unblock_contacts_async() + * tp_blockable_contact_list_unblock_contacts_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_unblock_contacts_async(). + * tp_blockable_contact_list_unblock_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method. @@ -2455,7 +2723,7 @@ tp_base_contact_list_unblock_contacts_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_unblock_contacts_finish (TpBaseContactList *self, +tp_blockable_contact_list_unblock_contacts_finish (TpBlockableContactList *self, GAsyncResult *result, GError **error) { @@ -2470,7 +2738,7 @@ tp_base_contact_list_unblock_contacts_finish (TpBaseContactList *self, } /** - * TpBaseContactListNormalizeFunc: + * TpContactGroupListNormalizeFunc: * @self: a contact list manager * @s: a non-%NULL name to normalize * @@ -2483,16 +2751,15 @@ tp_base_contact_list_unblock_contacts_finish (TpBaseContactList *self, */ /** - * tp_base_contact_list_normalize_group: - * @self: a contact list manager + * tp_contact_group_list_normalize_group: + * @self: a contact list manager implementing #TP_TYPE_CONTACT_GROUP_LIST * @s: a non-%NULL group name to normalize * * Return a normalized form of the group name @s, or %NULL if a group of a * sufficiently similar name cannot be created. * - * If the #TpBaseContactList subclass does not implement - * %TP_TYPE_CONTACT_GROUP_LIST, this method is meaningless, and always - * returns %NULL. + * It is an error to call this function if @self does not implement + * %TP_TYPE_CONTACT_GROUP_LIST. * * For implementations of %TP_TYPE_CONTACT_GROUP_LIST, this is a virtual * method, implemented using #TpContactGroupListInterface.normalize_group. @@ -2508,17 +2775,14 @@ tp_base_contact_list_unblock_contacts_finish (TpBaseContactList *self, * Since: 0.13.0 */ gchar * -tp_base_contact_list_normalize_group (TpBaseContactList *self, +tp_contact_group_list_normalize_group (TpContactGroupList *self, const gchar *s) { TpContactGroupListInterface *iface; - g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), NULL); + g_return_val_if_fail (TP_IS_CONTACT_GROUP_LIST (self), NULL); g_return_val_if_fail (s != NULL, NULL); - if (!TP_IS_CONTACT_GROUP_LIST (self)) - return NULL; - iface = TP_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, FALSE); @@ -2536,22 +2800,22 @@ update_groups_property (TpBaseContactList *self) if (self->priv->contact_groups_skeleton == NULL) return; - groups = tp_base_contact_list_dup_groups (self); + groups = tp_contact_group_list_dup_groups (TP_CONTACT_GROUP_LIST (self)); _tp_gdbus_connection_interface_contact_groups1_set_groups ( self->priv->contact_groups_skeleton, (const gchar * const *) groups); g_strfreev (groups); } /** - * tp_base_contact_list_groups_created: - * @self: a contact list manager + * tp_contact_group_list_groups_created: + * @self: a contact list manager implementing #TP_TYPE_CONTACT_GROUP_LIST * @created: (array length=n_created) (element-type utf8) (allow-none): zero * or more groups that were created * @n_created: the number of groups created, or -1 if @created is * %NULL-terminated * * Called by subclasses when new groups have been created. This will typically - * be followed by a call to tp_base_contact_list_groups_changed() to add + * be followed by a call to tp_contact_group_list_groups_changed() to add * some members to those groups. * * It is an error to call this method on a contact list that @@ -2560,18 +2824,21 @@ update_groups_property (TpBaseContactList *self) * Since: 0.13.0 */ void -tp_base_contact_list_groups_created (TpBaseContactList *self, +tp_contact_group_list_groups_created (TpContactGroupList *contact_group, const gchar * const *created, gssize n_created) { + TpBaseContactList *self; GPtrArray *actually_created; gssize i; - g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); - g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); + g_return_if_fail (TP_IS_BASE_CONTACT_LIST (contact_group)); + g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (contact_group)); g_return_if_fail (n_created >= -1); g_return_if_fail (n_created <= 0 || created != NULL); + self = TP_BASE_CONTACT_LIST (contact_group); + if (n_created == 0 || created == NULL) return; @@ -2594,8 +2861,8 @@ tp_base_contact_list_groups_created (TpBaseContactList *self, for (i = 0; i < n_created; i++) { - gchar *normalized_group = tp_base_contact_list_normalize_group ( - self, created[i]); + gchar *normalized_group = tp_contact_group_list_normalize_group ( + contact_group, created[i]); if (g_hash_table_lookup (self->priv->groups, normalized_group) == NULL) { @@ -2629,8 +2896,8 @@ tp_base_contact_list_groups_created (TpBaseContactList *self, } /** - * tp_base_contact_list_groups_removed: - * @self: a contact list manager + * tp_contact_group_list_groups_removed: + * @self: a contact list manager implementing #TP_TYPE_CONTACT_GROUP_LIST * @removed: (array length=n_removed) (element-type utf8) (allow-none): zero * or more groups that were removed * @n_removed: the number of groups removed, or -1 if @removed is @@ -2638,9 +2905,9 @@ tp_base_contact_list_groups_created (TpBaseContactList *self, * * Called by subclasses when groups have been removed. * - * Calling tp_base_contact_list_dup_group_members() during this method should + * Calling tp_contact_group_list_dup_group_members() during this method should * return the groups' old members. If this is done correctly by a subclass, - * then tp_base_contact_list_groups_changed() will automatically be emitted + * then tp_contact_group_list_groups_changed() will automatically be emitted * for the old members, and the subclass does not need to do so. * * It is an error to call this method on a contact list that @@ -2649,20 +2916,23 @@ tp_base_contact_list_groups_created (TpBaseContactList *self, * Since: 0.13.0 */ void -tp_base_contact_list_groups_removed (TpBaseContactList *self, +tp_contact_group_list_groups_removed (TpContactGroupList *contact_group, const gchar * const *removed, gssize n_removed) { + TpBaseContactList *self; GPtrArray *actually_removed; gssize i; TpHandleSet *old_members; - g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); - g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); + g_return_if_fail (TP_IS_BASE_CONTACT_LIST (contact_group)); + g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (contact_group)); g_return_if_fail (removed != NULL); g_return_if_fail (n_removed >= -1); g_return_if_fail (n_removed <= 0 || removed != NULL); + self = (TpBaseContactList *) contact_group; + if (n_removed == 0 || removed == NULL) return; @@ -2686,8 +2956,8 @@ tp_base_contact_list_groups_removed (TpBaseContactList *self, for (i = 0; i < n_removed; i++) { - gchar *normalized_group = tp_base_contact_list_normalize_group ( - self, removed[i]); + gchar *normalized_group = tp_contact_group_list_normalize_group ( + TP_CONTACT_GROUP_LIST (self), removed[i]); TpHandleSet *group_members = g_hash_table_lookup (self->priv->groups, normalized_group); TpHandle contact; @@ -2751,16 +3021,16 @@ tp_base_contact_list_groups_removed (TpBaseContactList *self, } /** - * tp_base_contact_list_group_renamed: - * @self: a contact list manager + * tp_contact_group_list_group_renamed: + * @self: a contact list manager implementing #TP_TYPE_CONTACT_GROUP_LIST * @old_name: the group's old name * @new_name: the group's new name * * Called by subclasses when a group has been renamed. * - * Calling tp_base_contact_list_dup_group_members() for @old_name during this + * Calling tp_contact_group_list_dup_group_members() for @old_name during this * method should return the group's old members. If this is done correctly by - * a subclass, then tp_base_contact_list_groups_changed() will automatically + * a subclass, then tp_contact_group_list_groups_changed() will automatically * be emitted for the members, and the subclass does not need to do so. * * It is an error to call this method on a contact list that @@ -2769,17 +3039,20 @@ tp_base_contact_list_groups_removed (TpBaseContactList *self, * Since: 0.13.0 */ void -tp_base_contact_list_group_renamed (TpBaseContactList *self, +tp_contact_group_list_group_renamed (TpContactGroupList *contact_group, const gchar *old_name, const gchar *new_name) { + TpBaseContactList *self; const gchar *old_names[] = { old_name, NULL }; const gchar *new_names[] = { new_name, NULL }; const TpIntset *set; TpHandleSet *old_members; - g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); - g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); + g_return_if_fail (TP_IS_BASE_CONTACT_LIST (contact_group)); + g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (contact_group)); + + self = (TpBaseContactList *) contact_group; if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; @@ -2800,7 +3073,8 @@ tp_base_contact_list_group_renamed (TpBaseContactList *self, self->priv->contact_groups_skeleton, old_names); } - old_members = tp_base_contact_list_dup_group_members (self, old_name); + old_members = tp_contact_group_list_dup_group_members ( + TP_CONTACT_GROUP_LIST (self), old_name); set = tp_handle_set_peek (old_members); if (tp_intset_size (set) > 0) @@ -2853,8 +3127,8 @@ remove_contacts_from_handle_set (TpHandleSet *set, } /** - * tp_base_contact_list_groups_changed: - * @self: a contact list manager + * tp_contact_group_list_groups_changed: + * @self: a contact list manager implementing #TP_TYPE_CONTACT_GROUP_LIST * @contacts: a set containing one or more contacts * @added: (array length=n_added) (element-type utf8) (allow-none): zero or * more groups to which the @contacts were added, or %NULL (which has the @@ -2870,7 +3144,7 @@ remove_contacts_from_handle_set (TpHandleSet *set, * * If any of the groups in @added are not already known to exist, * this method also signals that they were created, as if - * tp_base_contact_list_groups_created() had been called first. + * tp_contact_group_list_groups_created() had been called first. * * It is an error to call this method on a contact list that * does not implement %TP_TYPE_CONTACT_GROUP_LIST. @@ -2878,24 +3152,27 @@ remove_contacts_from_handle_set (TpHandleSet *set, * Since: 0.13.0 */ void -tp_base_contact_list_groups_changed (TpBaseContactList *self, +tp_contact_group_list_groups_changed (TpContactGroupList *contact_group, TpHandleSet *contacts, const gchar * const *added, gssize n_added, const gchar * const *removed, gssize n_removed) { + TpBaseContactList *self; gssize i; GPtrArray *really_added, *really_removed; - g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); - g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); + g_return_if_fail (TP_IS_BASE_CONTACT_LIST (contact_group)); + g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (contact_group)); g_return_if_fail (contacts != NULL); g_return_if_fail (n_added >= -1); g_return_if_fail (n_removed >= -1); g_return_if_fail (n_added <= 0 || added != NULL); g_return_if_fail (n_removed <= 0 || removed != NULL); + self = (TpBaseContactList *) contact_group; + if (tp_handle_set_is_empty (contacts)) { DEBUG ("No contacts, doing nothing"); @@ -2939,7 +3216,7 @@ tp_base_contact_list_groups_changed (TpBaseContactList *self, " groups, removing %" G_GSSIZE_FORMAT, tp_handle_set_size (contacts), n_added, n_removed); - tp_base_contact_list_groups_created (self, added, n_added); + tp_contact_group_list_groups_created (contact_group, added, n_added); /* These two arrays are lists of the groups whose members really changed; * groups where the change was a no-op are skipped. */ @@ -2948,8 +3225,8 @@ tp_base_contact_list_groups_changed (TpBaseContactList *self, for (i = 0; i < n_added; i++) { - gchar *normalized_group = tp_base_contact_list_normalize_group ( - self, added[i]); + gchar *normalized_group = tp_contact_group_list_normalize_group ( + contact_group, added[i]); TpHandleSet *contacts_in_group = g_hash_table_lookup (self->priv->groups, normalized_group); @@ -2975,8 +3252,8 @@ tp_base_contact_list_groups_changed (TpBaseContactList *self, for (i = 0; i < n_removed; i++) { - gchar *normalized_group = tp_base_contact_list_normalize_group ( - self, removed[i]); + gchar *normalized_group = tp_contact_group_list_normalize_group ( + contact_group, removed[i]); TpHandleSet *contacts_in_group = g_hash_table_lookup (self->priv->groups, normalized_group); @@ -3026,8 +3303,8 @@ tp_base_contact_list_groups_changed (TpBaseContactList *self, } /** - * tp_base_contact_list_one_contact_groups_changed: - * @self: the contact list manager + * tp_contact_group_list_one_contact_groups_changed: + * @self: the contact list manager implementing #TP_TYPE_CONTACT_GROUP_LIST * @contact: a contact handle * @added: (array length=n_added) (element-type utf8) (allow-none): zero or * more groups to which @contact was added, or %NULL @@ -3037,50 +3314,84 @@ tp_base_contact_list_groups_changed (TpBaseContactList *self, * @n_removed: the number of groups removed, or -1 if @removed is * %NULL-terminated * - * Convenience wrapper around tp_base_contact_list_groups_changed() for a + * Convenience wrapper around tp_contact_group_list_groups_changed() for a * single handle in the 'contacts' set. * * (There is no equivalent function for @added and @removed having trivial * contents, because you can already use <code>NULL, 0</code> for an empty * list or <code>&group_name, 1</code> for a single group.) * + * It is an error to call this function if @self does not implement + * %TP_TYPE_CONTACT_GROUP_LIST. + * * Since: 0.13.0 */ void -tp_base_contact_list_one_contact_groups_changed (TpBaseContactList *self, +tp_contact_group_list_one_contact_groups_changed ( + TpContactGroupList *contact_group, TpHandle contact, const gchar * const *added, gssize n_added, const gchar * const *removed, gssize n_removed) { + TpBaseContactList *self; TpHandleSet *set; - g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); + g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (contact_group)); + + self = (TpBaseContactList *) contact_group; /* if we're disconnecting, we might not have a handle repository any more: - * tp_base_contact_list_groups_changed does nothing in that situation */ + * tp_contact_group_list_groups_changed does nothing in that situation */ if (self->priv->contact_repo == NULL) return; set = tp_handle_set_new_containing (self->priv->contact_repo, contact); - tp_base_contact_list_groups_changed (self, set, added, n_added, removed, - n_removed); + tp_contact_group_list_groups_changed (TP_CONTACT_GROUP_LIST (self), set, added, + n_added, removed, n_removed); tp_handle_set_destroy (set); } /** - * tp_base_contact_list_has_disjoint_groups: - * @self: a contact list manager + * TpContactGroupListBooleanFunc: + * @self: a contact list manager implementing TpContactGroupListInterface + * + * Signature of a virtual method that returns a boolean result. + * + * Returns: a boolean result + * + * Since: UNRELEASED + */ + +/** + * tp_contact_group_list_false_func: + * @self: ignored + * + * An implementation of #TpContactGroupListBooleanFunc that returns %FALSE, + * for use in simple cases. + * + * Returns: %FALSE + * + * Since: UNRELEASED + */ +gboolean +tp_contact_group_list_false_func (TpContactGroupList *self G_GNUC_UNUSED) +{ + return FALSE; +} + +/** + * tp_contact_group_list_has_disjoint_groups: + * @self: a contact list manager implementing #TP_TYPE_CONTACT_GROUP_LIST * * Return whether groups in this protocol are disjoint * (i.e. each contact can be in at most one group). * This is merely informational: subclasses are responsible for making - * appropriate calls to tp_base_contact_list_groups_changed(), etc. + * appropriate calls to tp_contact_group_list_groups_changed(), etc. * - * If the #TpBaseContactList subclass does not implement - * %TP_TYPE_CONTACT_GROUP_LIST, this method is meaningless, and always - * returns %FALSE. + * It is an error to call this function if @self does not implement + * %TP_TYPE_CONTACT_GROUP_LIST. * * For implementations of %TP_TYPE_CONTACT_GROUP_LIST, this is a virtual * method, implemented using #TpContactGroupListInterface.has_disjoint_groups. @@ -3096,24 +3407,21 @@ tp_base_contact_list_one_contact_groups_changed (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_has_disjoint_groups (TpBaseContactList *self) +tp_contact_group_list_has_disjoint_groups (TpContactGroupList *self) { TpContactGroupListInterface *iface; - g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), FALSE); - - if (!TP_IS_CONTACT_GROUP_LIST (self)) - return FALSE; + g_return_val_if_fail (TP_IS_CONTACT_GROUP_LIST (self), FALSE); iface = TP_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->has_disjoint_groups != NULL, FALSE); - return iface->has_disjoint_groups (self); + return iface->has_disjoint_groups (TP_CONTACT_GROUP_LIST (self)); } /** - * TpBaseContactListDupGroupsFunc: + * TpContactGroupListDupGroupsFunc: * @self: a contact list manager * * Signature of a virtual method that lists every group that exists on a @@ -3126,8 +3434,8 @@ tp_base_contact_list_has_disjoint_groups (TpBaseContactList *self) */ /** - * tp_base_contact_list_dup_groups: - * @self: a contact list manager + * tp_contact_group_list_dup_groups: + * @self: a contact list manager implementing #TP_TYPE_CONTACT_GROUP_LIST * * Return a list of all groups on this connection. It is incorrect to call * this method before tp_base_contact_list_set_list_received() has been @@ -3144,21 +3452,22 @@ tp_base_contact_list_has_disjoint_groups (TpBaseContactList *self) * Since: 0.13.0 */ GStrv -tp_base_contact_list_dup_groups (TpBaseContactList *self) +tp_contact_group_list_dup_groups (TpContactGroupList *self) { TpContactGroupListInterface *iface = TP_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->dup_groups != NULL, NULL); - g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == - TP_CONTACT_LIST_STATE_SUCCESS, NULL); + g_return_val_if_fail (tp_base_contact_list_get_state ( + TP_BASE_CONTACT_LIST (self), NULL) == TP_CONTACT_LIST_STATE_SUCCESS, + NULL); return iface->dup_groups (self); } /** - * TpBaseContactListDupContactGroupsFunc: + * TpContactGroupListDupContactGroupsFunc: * @self: a contact list manager * @contact: a non-zero contact handle * @@ -3175,7 +3484,7 @@ tp_base_contact_list_dup_groups (TpBaseContactList *self) */ /** - * tp_base_contact_list_dup_contact_groups: + * tp_contact_group_list_dup_contact_groups: * @self: a contact list manager * @contact: a contact handle * @@ -3197,7 +3506,7 @@ tp_base_contact_list_dup_groups (TpBaseContactList *self) * Since: 0.13.0 */ GStrv -tp_base_contact_list_dup_contact_groups (TpBaseContactList *self, +tp_contact_group_list_dup_contact_groups (TpContactGroupList *self, TpHandle contact) { TpContactGroupListInterface *iface = @@ -3205,14 +3514,15 @@ tp_base_contact_list_dup_contact_groups (TpBaseContactList *self, g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->dup_contact_groups != NULL, NULL); - g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == - TP_CONTACT_LIST_STATE_SUCCESS, NULL); + g_return_val_if_fail (tp_base_contact_list_get_state ( + TP_BASE_CONTACT_LIST (self), NULL) == TP_CONTACT_LIST_STATE_SUCCESS, + NULL); return iface->dup_contact_groups (self, contact); } /** - * TpBaseContactListDupGroupMembersFunc: + * TpContactGroupListDupGroupMembersFunc: * @self: a contact list manager * @group: a normalized group name * @@ -3224,7 +3534,7 @@ tp_base_contact_list_dup_contact_groups (TpBaseContactList *self, */ /** - * tp_base_contact_list_dup_group_members: + * tp_contact_group_list_dup_group_members: * @self: a contact list manager * @group: a normalized group name * @@ -3245,7 +3555,7 @@ tp_base_contact_list_dup_contact_groups (TpBaseContactList *self, * Since: 0.13.0 */ TpHandleSet * -tp_base_contact_list_dup_group_members (TpBaseContactList *self, +tp_contact_group_list_dup_group_members (TpContactGroupList *self, const gchar *group) { TpContactGroupListInterface *iface = @@ -3253,14 +3563,15 @@ tp_base_contact_list_dup_group_members (TpBaseContactList *self, g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->dup_group_members != NULL, NULL); - g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == - TP_CONTACT_LIST_STATE_SUCCESS, NULL); + g_return_val_if_fail (tp_base_contact_list_get_state ( + TP_BASE_CONTACT_LIST (self), NULL) == TP_CONTACT_LIST_STATE_SUCCESS, + NULL); return iface->dup_group_members (self, group); } /** - * TpBaseContactListGroupContactsFunc: + * TpMutableContactGroupListGroupContactsFunc: * @self: a contact list manager * @group: a group * @contacts: a set of contact handles @@ -3273,7 +3584,7 @@ tp_base_contact_list_dup_group_members (TpBaseContactList *self, */ /** - * tp_base_contact_list_add_to_group_async: + * tp_mutable_contact_group_list_add_to_group_async: * @self: a contact list manager * @group: the normalized name of a group * @contacts: some contacts (may be an empty set) @@ -3291,13 +3602,13 @@ tp_base_contact_list_dup_group_members (TpBaseContactList *self, * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.add_to_group_async. - * The implementation should call tp_base_contact_list_groups_changed() + * The implementation should call tp_contact_group_list_groups_changed() * for any changes it successfully made, before calling @callback. * * Since: 0.13.0 */ void -tp_base_contact_list_add_to_group_async (TpBaseContactList *self, +tp_mutable_contact_group_list_add_to_group_async (TpMutableContactGroupList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, @@ -3313,14 +3624,14 @@ tp_base_contact_list_add_to_group_async (TpBaseContactList *self, } /** - * tp_base_contact_list_add_to_group_finish: + * tp_mutable_contact_group_list_add_to_group_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_add_to_group_async() + * tp_mutable_contact_group_list_add_to_group_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_add_to_group_async(). + * tp_mutable_contact_group_list_add_to_group_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. @@ -3335,7 +3646,7 @@ tp_base_contact_list_add_to_group_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_add_to_group_finish (TpBaseContactList *self, +tp_mutable_contact_group_list_add_to_group_finish (TpMutableContactGroupList *self, GAsyncResult *result, GError **error) { @@ -3350,7 +3661,7 @@ tp_base_contact_list_add_to_group_finish (TpBaseContactList *self, } /** - * TpBaseContactListRenameGroupFunc: + * TpMutableContactGroupListRenameGroupFunc: * @self: a contact list manager * @old_name: a group * @new_name: a new name for the group @@ -3363,7 +3674,7 @@ tp_base_contact_list_add_to_group_finish (TpBaseContactList *self, */ /** - * tp_base_contact_list_rename_group_async: + * tp_mutable_contact_group_list_rename_group_async: * @self: a contact list manager * @old_name: the normalized name of a group, which must exist * @new_name: a new normalized name for the group name @@ -3385,13 +3696,13 @@ tp_base_contact_list_add_to_group_finish (TpBaseContactList *self, * members to it, and removing the old group: this is appropriate for protocols * like XMPP, in which groups behave more like tags. * - * The implementation should call tp_base_contact_list_group_renamed() before + * The implementation should call tp_contact_group_list_group_renamed() before * calling @callback. * * Since: 0.13.0 */ void -tp_base_contact_list_rename_group_async (TpBaseContactList *self, +tp_mutable_contact_group_list_rename_group_async (TpMutableContactGroupList *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, @@ -3404,8 +3715,7 @@ tp_base_contact_list_rename_group_async (TpBaseContactList *self, g_return_if_fail (iface != NULL); g_return_if_fail (iface->rename_group_async != NULL); - iface->rename_group_async (self, old_name, new_name, callback, - user_data); + iface->rename_group_async (self, old_name, new_name, callback, user_data); } static void @@ -3413,11 +3723,11 @@ emulate_rename_group_remove_cb (GObject *source, GAsyncResult *result, gpointer user_data) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactGroupList *self = TP_MUTABLE_CONTACT_GROUP_LIST (source); GSimpleAsyncResult *rename_result = user_data; GError *error = NULL; - if (!tp_base_contact_list_remove_group_finish (self, result, &error)) + if (!tp_mutable_contact_group_list_remove_group_finish (self, result, &error)) { g_simple_async_result_set_from_error (rename_result, error); g_clear_error (&error); @@ -3432,11 +3742,11 @@ emulate_rename_group_add_cb (GObject *source, GAsyncResult *result, gpointer user_data) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactGroupList *self = TP_MUTABLE_CONTACT_GROUP_LIST (source); GSimpleAsyncResult *rename_result = user_data; GError *error = NULL; - if (!tp_base_contact_list_add_to_group_finish (self, result, &error)) + if (!tp_mutable_contact_group_list_add_to_group_finish (self, result, &error)) { g_simple_async_result_set_from_error (rename_result, error); g_clear_error (&error); @@ -3444,7 +3754,7 @@ emulate_rename_group_add_cb (GObject *source, goto out; } - tp_base_contact_list_remove_group_async (self, + tp_mutable_contact_group_list_remove_group_async (self, g_simple_async_result_get_op_res_gpointer (rename_result), emulate_rename_group_remove_cb, g_object_ref (rename_result)); @@ -3453,7 +3763,7 @@ out: } static void -tp_base_contact_list_emulate_rename_group (TpBaseContactList *self, +tp_base_contact_list_emulate_rename_group (TpMutableContactGroupList *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, @@ -3469,22 +3779,24 @@ tp_base_contact_list_emulate_rename_group (TpBaseContactList *self, g_simple_async_result_set_op_res_gpointer (result, g_strdup (old_name), g_free); - old_members = tp_base_contact_list_dup_group_members (self, old_name); - tp_base_contact_list_add_to_group_async (self, new_name, old_members, - emulate_rename_group_add_cb, g_object_ref (result)); + old_members = tp_contact_group_list_dup_group_members ( + TP_CONTACT_GROUP_LIST (self), old_name); + tp_mutable_contact_group_list_add_to_group_async (self, + new_name, old_members, emulate_rename_group_add_cb, + g_object_ref (result)); g_object_unref (result); tp_handle_set_destroy (old_members); } /** - * tp_base_contact_list_rename_group_finish: + * tp_mutable_contact_group_list_rename_group_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_rename_group_async() + * tp_mutable_contact_group_list_rename_group_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_rename_group_async(). + * tp_mutable_contact_group_list_rename_group_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. @@ -3499,7 +3811,7 @@ tp_base_contact_list_emulate_rename_group (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_rename_group_finish (TpBaseContactList *self, +tp_mutable_contact_group_list_rename_group_finish (TpMutableContactGroupList *self, GAsyncResult *result, GError **error) { @@ -3514,7 +3826,7 @@ tp_base_contact_list_rename_group_finish (TpBaseContactList *self, } /** - * tp_base_contact_list_remove_from_group_async: + * tp_mutable_contact_group_list_remove_from_group_async: * @self: a contact list manager * @group: the normalized name of a group * @contacts: some contacts @@ -3529,12 +3841,13 @@ tp_base_contact_list_rename_group_finish (TpBaseContactList *self, * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.remove_from_group_async. - * The implementation should call tp_base_contact_list_groups_changed() + * The implementation should call tp_contact_group_list_groups_changed() * for any changes it successfully made, before calling @callback. * * Since: 0.13.0 */ -void tp_base_contact_list_remove_from_group_async (TpBaseContactList *self, +void tp_mutable_contact_group_list_remove_from_group_async ( + TpMutableContactGroupList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, @@ -3550,14 +3863,14 @@ void tp_base_contact_list_remove_from_group_async (TpBaseContactList *self, } /** - * tp_base_contact_list_remove_from_group_finish: + * tp_mutable_contact_group_list_remove_from_group_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_remove_from_group_async() + * tp_mutable_contact_group_list_remove_from_group_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_remove_from_group_async(). + * tp_mutable_contact_group_list_remove_from_group_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. @@ -3572,7 +3885,7 @@ void tp_base_contact_list_remove_from_group_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_remove_from_group_finish (TpBaseContactList *self, +tp_mutable_contact_group_list_remove_from_group_finish (TpMutableContactGroupList *self, GAsyncResult *result, GError **error) { @@ -3587,7 +3900,7 @@ tp_base_contact_list_remove_from_group_finish (TpBaseContactList *self, } /** - * TpBaseContactListRemoveGroupFunc: + * TpMutableContactGroupListRemoveGroupFunc: * @self: a contact list manager * @group: the normalized name of a group * @callback: a callback to call on success, failure or disconnection @@ -3599,7 +3912,7 @@ tp_base_contact_list_remove_from_group_finish (TpBaseContactList *self, */ /** - * tp_base_contact_list_remove_group_async: + * tp_mutable_contact_group_list_remove_group_async: * @self: a contact list manager * @group: the normalized name of a group * @callback: a callback to call on success, failure or disconnection @@ -3613,13 +3926,13 @@ tp_base_contact_list_remove_from_group_finish (TpBaseContactList *self, * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.remove_group_async. - * The implementation should call tp_base_contact_list_groups_removed() + * The implementation should call tp_contact_group_list_groups_removed() * for any groups it successfully removed, before calling @callback. * * Since: 0.13.0 */ void -tp_base_contact_list_remove_group_async (TpBaseContactList *self, +tp_mutable_contact_group_list_remove_group_async (TpMutableContactGroupList *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) @@ -3634,14 +3947,14 @@ tp_base_contact_list_remove_group_async (TpBaseContactList *self, } /** - * tp_base_contact_list_remove_group_finish: + * tp_mutable_contact_group_list_remove_group_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_remove_group_async() + * tp_mutable_contact_group_list_remove_group_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_remove_group_async(). + * tp_mutable_contact_group_list_remove_group_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. @@ -3656,7 +3969,7 @@ tp_base_contact_list_remove_group_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_remove_group_finish (TpBaseContactList *self, +tp_mutable_contact_group_list_remove_group_finish (TpMutableContactGroupList *self, GAsyncResult *result, GError **error) { @@ -3708,7 +4021,7 @@ tp_base_contact_list_mixin_get_contact_list_attributes ( } /** - * TpBaseContactListSetContactGroupsFunc: + * TpMutableContactGroupListSetContactGroupsFunc: * @self: a contact list manager * @contact: a contact handle * @normalized_names: (array length=n_names): the normalized names of some @@ -3718,13 +4031,13 @@ tp_base_contact_list_mixin_get_contact_list_attributes ( * @user_data: user data for the callback * * Signature of an implementation of - * tp_base_contact_list_set_contact_groups_async(). + * tp_mutable_contact_group_list_set_contact_groups_async(). * * Since: 0.13.0 */ /** - * tp_base_contact_list_set_contact_groups_async: + * tp_mutable_contact_group_list_set_contact_groups_async: * @self: a contact list manager * @contact: a contact handle * @normalized_names: (array length=n_names): the normalized names of some @@ -3742,12 +4055,13 @@ tp_base_contact_list_mixin_get_contact_list_attributes ( * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.set_contact_groups_async. - * The implementation should call tp_base_contact_list_groups_changed() + * The implementation should call tp_contact_group_list_groups_changed() * for any changes it successfully made, before returning. * * Since: 0.13.0 */ -void tp_base_contact_list_set_contact_groups_async (TpBaseContactList *self, +void tp_mutable_contact_group_list_set_contact_groups_async ( + TpMutableContactGroupList *self, TpHandle contact, const gchar * const *normalized_names, gsize n_names, @@ -3765,14 +4079,14 @@ void tp_base_contact_list_set_contact_groups_async (TpBaseContactList *self, } /** - * tp_base_contact_list_set_contact_groups_finish: + * tp_mutable_contact_group_list_set_contact_groups_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_set_contact_groups_async() + * tp_mutable_contact_group_list_set_contact_groups_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_set_contact_groups_async(). + * tp_mutable_contact_group_list_set_contact_groups_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. @@ -3788,7 +4102,7 @@ void tp_base_contact_list_set_contact_groups_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_set_contact_groups_finish (TpBaseContactList *self, +tp_mutable_contact_group_list_set_contact_groups_finish (TpMutableContactGroupList *self, GAsyncResult *result, GError **error) { @@ -3803,17 +4117,17 @@ tp_base_contact_list_set_contact_groups_finish (TpBaseContactList *self, } /** - * tp_base_contact_list_set_group_members_async: + * tp_mutable_contact_group_list_set_group_members_async: * @self: a contact list manager - * @normalized_group: the normalized name of a group + * @group: the normalized name of a group * @contacts: the contacts who should be in the group * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * - * Set the members of @normalized_group to be exactly @contacts (i.e. + * Set the members of @group to be exactly @contacts (i.e. * add @contacts, and simultaneously remove all members not in @contacts). * - * If @normalized_group does not exist, the implementation should create it, + * If @group does not exist, the implementation should create it, * even if @contacts is empty. * * If the #TpBaseContactList subclass does not implement @@ -3822,14 +4136,14 @@ tp_base_contact_list_set_contact_groups_finish (TpBaseContactList *self, * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.set_group_members_async. - * The implementation should call tp_base_contact_list_groups_changed() + * The implementation should call tp_contact_group_list_groups_changed() * for any changes it successfully made, before calling @callback. * * Since: 0.13.0 */ void -tp_base_contact_list_set_group_members_async (TpBaseContactList *self, - const gchar *normalized_group, +tp_mutable_contact_group_list_set_group_members_async (TpMutableContactGroupList *self, + const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -3840,19 +4154,19 @@ tp_base_contact_list_set_group_members_async (TpBaseContactList *self, g_return_if_fail (mutable_groups_iface != NULL); g_return_if_fail (mutable_groups_iface->set_group_members_async != NULL); - mutable_groups_iface->set_group_members_async (self, normalized_group, + mutable_groups_iface->set_group_members_async (self, group, contacts, callback, user_data); } /** - * tp_base_contact_list_set_group_members_finish: + * tp_mutable_contact_group_list_set_group_members_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of - * tp_base_contact_list_set_group_members_async() + * tp_mutable_contact_group_list_set_group_members_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to - * tp_base_contact_list_set_group_members_async(). + * tp_mutable_contact_group_list_set_group_members_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. @@ -3867,7 +4181,7 @@ tp_base_contact_list_set_group_members_async (TpBaseContactList *self, * Since: 0.13.0 */ gboolean -tp_base_contact_list_set_group_members_finish (TpBaseContactList *self, +tp_mutable_contact_group_list_set_group_members_finish (TpMutableContactGroupList *self, GAsyncResult *result, GError **error) { @@ -3954,10 +4268,10 @@ tp_base_contact_list_mixin_request_subscription_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactList *self = TP_MUTABLE_CONTACT_LIST (source); GError *error = NULL; - tp_base_contact_list_request_subscription_finish (self, result, &error); + tp_mutable_contact_list_request_subscription_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -3982,7 +4296,8 @@ tp_base_contact_list_mixin_request_subscription ( contacts_set = tp_handle_set_new_from_variant (self->priv->contact_repo, contacts_variant); - tp_base_contact_list_request_subscription_async (self, contacts_set, message, + tp_mutable_contact_list_request_subscription_async ( + TP_MUTABLE_CONTACT_LIST (self), contacts_set, message, tp_base_contact_list_mixin_request_subscription_cb, context); tp_handle_set_destroy (contacts_set); @@ -3995,10 +4310,10 @@ tp_base_contact_list_mixin_authorize_publication_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactList *self = TP_MUTABLE_CONTACT_LIST (source); GError *error = NULL; - tp_base_contact_list_authorize_publication_finish (self, result, &error); + tp_mutable_contact_list_authorize_publication_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4022,7 +4337,8 @@ tp_base_contact_list_mixin_authorize_publication ( contacts_set = tp_handle_set_new_from_variant (self->priv->contact_repo, contacts_variant); - tp_base_contact_list_authorize_publication_async (self, contacts_set, + tp_mutable_contact_list_authorize_publication_async ( + TP_MUTABLE_CONTACT_LIST (self), contacts_set, tp_base_contact_list_mixin_authorize_publication_cb, context); tp_handle_set_destroy (contacts_set); @@ -4035,10 +4351,10 @@ tp_base_contact_list_mixin_remove_contacts_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactList *self = TP_MUTABLE_CONTACT_LIST (source); GError *error = NULL; - tp_base_contact_list_remove_contacts_finish (self, result, &error); + tp_mutable_contact_list_remove_contacts_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4062,7 +4378,8 @@ tp_base_contact_list_mixin_remove_contacts ( contacts_set = tp_handle_set_new_from_variant (self->priv->contact_repo, contacts_variant); - tp_base_contact_list_remove_contacts_async (self, contacts_set, + tp_mutable_contact_list_remove_contacts_async ( + TP_MUTABLE_CONTACT_LIST (self), contacts_set, tp_base_contact_list_mixin_remove_contacts_cb, context); tp_handle_set_destroy (contacts_set); @@ -4075,10 +4392,10 @@ tp_base_contact_list_mixin_unsubscribe_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactList *self = TP_MUTABLE_CONTACT_LIST (source); GError *error = NULL; - tp_base_contact_list_unsubscribe_finish (self, result, &error); + tp_mutable_contact_list_unsubscribe_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4102,8 +4419,8 @@ tp_base_contact_list_mixin_unsubscribe ( contacts_set = tp_handle_set_new_from_variant (self->priv->contact_repo, contacts_variant); - tp_base_contact_list_unsubscribe_async (self, contacts_set, - tp_base_contact_list_mixin_unsubscribe_cb, context); + tp_mutable_contact_list_unsubscribe_async (TP_MUTABLE_CONTACT_LIST (self), + contacts_set, tp_base_contact_list_mixin_unsubscribe_cb, context); tp_handle_set_destroy (contacts_set); out: @@ -4115,10 +4432,10 @@ tp_base_contact_list_mixin_unpublish_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactList *self = TP_MUTABLE_CONTACT_LIST (source); GError *error = NULL; - tp_base_contact_list_unpublish_finish (self, result, &error); + tp_mutable_contact_list_unpublish_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4142,8 +4459,8 @@ tp_base_contact_list_mixin_unpublish ( contacts_set = tp_handle_set_new_from_variant (self->priv->contact_repo, contacts_variant); - tp_base_contact_list_unpublish_async (self, contacts_set, - tp_base_contact_list_mixin_unpublish_cb, context); + tp_mutable_contact_list_unpublish_async (TP_MUTABLE_CONTACT_LIST (self), + contacts_set, tp_base_contact_list_mixin_unpublish_cb, context); tp_handle_set_destroy (contacts_set); out: @@ -4215,7 +4532,8 @@ tp_base_contact_list_fill_contact_attributes (TpBaseContactList *self, { gchar **groups; - groups = tp_base_contact_list_dup_contact_groups (self, contact); + groups = tp_contact_group_list_dup_contact_groups ( + TP_CONTACT_GROUP_LIST (self), contact); g_variant_dict_insert (attributes, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS1_GROUPS, "^a&s", groups); @@ -4234,7 +4552,8 @@ tp_base_contact_list_fill_contact_attributes (TpBaseContactList *self, { g_variant_dict_insert (attributes, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING1_BLOCKED, - "b", tp_base_contact_list_is_blocked (self, contact)); + "b", tp_blockable_contact_list_is_blocked ( + TP_BLOCKABLE_CONTACT_LIST (self), contact)); } /* else just omit the attributes */ @@ -4314,7 +4633,7 @@ _tp_base_contact_list_implement_contact_list (TpBaseContactList *self) } /** - * TpBaseContactListUIntFunc: + * TpMutableContactGroupListUIntFunc: * @self: a contact list manager * * Signature of a virtual method that returns an unsigned integer result. @@ -4366,7 +4685,7 @@ tp_base_contact_list_get_group_storage (TpBaseContactList *self) if (iface->get_group_storage == NULL) return TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE; - return iface->get_group_storage (self); + return iface->get_group_storage (TP_MUTABLE_CONTACT_GROUP_LIST (self)); } static void @@ -4374,10 +4693,10 @@ tp_base_contact_list_mixin_set_contact_groups_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactGroupList *self = TP_MUTABLE_CONTACT_GROUP_LIST (source); GError *error = NULL; - tp_base_contact_list_set_contact_groups_finish (self, result, &error); + tp_mutable_contact_group_list_set_contact_groups_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4405,7 +4724,8 @@ tp_base_contact_list_mixin_set_contact_groups ( for (; groups != NULL && *groups != NULL; groups++) { - gchar *normalized = tp_base_contact_list_normalize_group (self, *groups); + gchar *normalized = tp_contact_group_list_normalize_group ( + TP_CONTACT_GROUP_LIST (self), *groups); if (normalized != NULL) { @@ -4417,7 +4737,8 @@ tp_base_contact_list_mixin_set_contact_groups ( } } - tp_base_contact_list_set_contact_groups_async (self, contact, + tp_mutable_contact_group_list_set_contact_groups_async ( + TP_MUTABLE_CONTACT_GROUP_LIST (self), contact, (const gchar * const *) normalized_groups->pdata, normalized_groups->len, tp_base_contact_list_mixin_set_contact_groups_cb, context); @@ -4439,10 +4760,10 @@ tp_base_contact_list_mixin_set_group_members_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactGroupList *self = TP_MUTABLE_CONTACT_GROUP_LIST (source); GError *error = NULL; - tp_base_contact_list_set_group_members_finish (self, result, &error); + tp_mutable_contact_group_list_set_group_members_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4467,7 +4788,8 @@ tp_base_contact_list_mixin_set_group_members ( contacts_set = tp_handle_set_new_from_variant (self->priv->contact_repo, contacts_variant); - tp_base_contact_list_set_group_members_async (self, + tp_mutable_contact_group_list_set_group_members_async ( + TP_MUTABLE_CONTACT_GROUP_LIST (self), group, contacts_set, tp_base_contact_list_mixin_set_group_members_cb, context); tp_handle_set_destroy (contacts_set); @@ -4481,10 +4803,10 @@ tp_base_contact_list_mixin_add_to_group_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactGroupList *self = TP_MUTABLE_CONTACT_GROUP_LIST (source); GError *error = NULL; - tp_base_contact_list_add_to_group_finish (self, result, &error); + tp_mutable_contact_group_list_add_to_group_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4508,7 +4830,8 @@ tp_base_contact_list_mixin_add_to_group ( goto out; } - normalized_group = tp_base_contact_list_normalize_group (self, group); + normalized_group = tp_contact_group_list_normalize_group ( + TP_CONTACT_GROUP_LIST (self), group); if (normalized_group == NULL) { tp_base_contact_list_mixin_return_void (context, NULL); @@ -4517,7 +4840,8 @@ tp_base_contact_list_mixin_add_to_group ( contacts_set = tp_handle_set_new_from_variant (self->priv->contact_repo, contacts_variant); - tp_base_contact_list_add_to_group_async (self, normalized_group, + tp_mutable_contact_group_list_add_to_group_async (TP_MUTABLE_CONTACT_GROUP_LIST (self), + normalized_group, contacts_set, tp_base_contact_list_mixin_add_to_group_cb, context); tp_handle_set_destroy (contacts_set); g_free (normalized_group); @@ -4531,10 +4855,10 @@ tp_base_contact_list_mixin_remove_from_group_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactGroupList *self = TP_MUTABLE_CONTACT_GROUP_LIST (source); GError *error = NULL; - tp_base_contact_list_remove_from_group_finish (self, result, &error); + tp_mutable_contact_group_list_remove_from_group_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4558,7 +4882,8 @@ tp_base_contact_list_mixin_remove_from_group ( goto out; } - normalized_group = tp_base_contact_list_normalize_group (self, group); + normalized_group = tp_contact_group_list_normalize_group ( + TP_CONTACT_GROUP_LIST (self), group); if (normalized_group == NULL || g_hash_table_lookup (self->priv->groups, normalized_group) == NULL) { @@ -4568,7 +4893,8 @@ tp_base_contact_list_mixin_remove_from_group ( contacts_set = tp_handle_set_new_from_variant (self->priv->contact_repo, contacts_variant); - tp_base_contact_list_remove_from_group_async (self, normalized_group, + tp_mutable_contact_group_list_remove_from_group_async ( + TP_MUTABLE_CONTACT_GROUP_LIST (self), normalized_group, contacts_set, tp_base_contact_list_mixin_remove_from_group_cb, context); tp_handle_set_destroy (contacts_set); @@ -4582,10 +4908,10 @@ tp_base_contact_list_mixin_remove_group_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactGroupList *self = TP_MUTABLE_CONTACT_GROUP_LIST (source); GError *error = NULL; - tp_base_contact_list_remove_group_finish (self, result, &error); + tp_mutable_contact_group_list_remove_group_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4607,7 +4933,8 @@ tp_base_contact_list_mixin_remove_group ( goto out; } - normalized_group = tp_base_contact_list_normalize_group (self, group); + normalized_group = tp_contact_group_list_normalize_group ( + TP_CONTACT_GROUP_LIST (self), group); if (normalized_group == NULL || g_hash_table_lookup (self->priv->groups, normalized_group) == NULL) { @@ -4615,8 +4942,8 @@ tp_base_contact_list_mixin_remove_group ( goto out; } - tp_base_contact_list_remove_group_async (self, group, - tp_base_contact_list_mixin_remove_group_cb, context); + tp_mutable_contact_group_list_remove_group_async (TP_MUTABLE_CONTACT_GROUP_LIST (self), + group, tp_base_contact_list_mixin_remove_group_cb, context); out: g_free (normalized_group); @@ -4628,10 +4955,10 @@ tp_base_contact_list_mixin_rename_group_cb (GObject *source, GAsyncResult *result, gpointer context) { - TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); + TpMutableContactGroupList *self = TP_MUTABLE_CONTACT_GROUP_LIST (source); GError *error = NULL; - tp_base_contact_list_rename_group_finish (self, result, &error); + tp_mutable_contact_group_list_rename_group_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } @@ -4647,6 +4974,7 @@ tp_base_contact_list_mixin_rename_group ( GError *error = NULL; gchar *old_normalized = NULL; gchar *new_normalized = NULL; + TpContactGroupList *contact_group = TP_CONTACT_GROUP_LIST (self); if (!tp_base_contact_list_check_group_change (self, NULL, &error)) { @@ -4656,7 +4984,7 @@ tp_base_contact_list_mixin_rename_group ( } /* todo: just use the normalize func directly */ - old_normalized = tp_base_contact_list_normalize_group (self, before); + old_normalized = tp_contact_group_list_normalize_group (contact_group, before); if (g_hash_table_lookup (self->priv->groups, old_normalized) == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_DOES_NOT_EXIST, @@ -4666,7 +4994,7 @@ tp_base_contact_list_mixin_rename_group ( goto out; } - new_normalized = tp_base_contact_list_normalize_group (self, after); + new_normalized = tp_contact_group_list_normalize_group (contact_group, after); if (g_hash_table_lookup (self->priv->groups, new_normalized) != NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, @@ -4676,7 +5004,7 @@ tp_base_contact_list_mixin_rename_group ( goto out; } - tp_base_contact_list_rename_group_async (self, + tp_mutable_contact_group_list_rename_group_async (TP_MUTABLE_CONTACT_GROUP_LIST (self), old_normalized, new_normalized, tp_base_contact_list_mixin_rename_group_cb, context); @@ -4757,7 +5085,8 @@ tp_base_contact_list_mixin_request_blocked_contacts ( case TP_CONTACT_LIST_STATE_SUCCESS: { - TpHandleSet *blocked = tp_base_contact_list_dup_blocked_contacts (self); + TpHandleSet *blocked = tp_blockable_contact_list_dup_blocked_contacts ( + TP_BLOCKABLE_CONTACT_LIST (self)); _tp_gdbus_connection_interface_contact_blocking1_complete_request_blocked_contacts ( skeleton, context, tp_handle_set_to_identifier_map (blocked)); @@ -4789,8 +5118,8 @@ blocked_cb ( GDBusMethodInvocation *context = user_data; GError *error = NULL; - if (tp_base_contact_list_block_contacts_with_abuse_finish (self, result, - &error)) + if (tp_blockable_contact_list_block_contacts_with_abuse_finish ( + TP_BLOCKABLE_CONTACT_LIST (self), result, &error)) { _tp_gdbus_connection_interface_contact_blocking1_complete_block_contacts ( self->priv->contact_blocking_skeleton, context); @@ -4821,8 +5150,9 @@ tp_base_contact_list_mixin_block_contacts ( while (g_variant_iter_loop (&iter, "u", &contact)) tp_handle_set_add (contacts, contact); - tp_base_contact_list_block_contacts_with_abuse_async (self, contacts, - report_abusive, blocked_cb, context); + tp_blockable_contact_list_block_contacts_with_abuse_async ( + TP_BLOCKABLE_CONTACT_LIST (self), contacts, report_abusive, blocked_cb, + context); tp_handle_set_destroy (contacts); @@ -4839,7 +5169,8 @@ unblocked_cb ( GDBusMethodInvocation *context = user_data; GError *error = NULL; - if (tp_base_contact_list_unblock_contacts_finish (self, result, &error)) + if (tp_blockable_contact_list_unblock_contacts_finish ( + TP_BLOCKABLE_CONTACT_LIST (self), result, &error)) { _tp_gdbus_connection_interface_contact_blocking1_complete_unblock_contacts ( self->priv->contact_blocking_skeleton, context); @@ -4869,8 +5200,8 @@ tp_base_contact_list_mixin_unblock_contacts ( while (g_variant_iter_loop (&iter, "u", &contact)) tp_handle_set_add (contacts, contact); - tp_base_contact_list_unblock_contacts_async (self, contacts, unblocked_cb, - context); + tp_blockable_contact_list_unblock_contacts_async (TP_BLOCKABLE_CONTACT_LIST (self), + contacts, unblocked_cb, context); tp_handle_set_destroy (contacts); diff --git a/telepathy-glib/base-contact-list.h b/telepathy-glib/base-contact-list.h index 86ce5dd50..5621682cd 100644 --- a/telepathy-glib/base-contact-list.h +++ b/telepathy-glib/base-contact-list.h @@ -166,49 +166,65 @@ struct _TpBaseContactListClass { (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_MUTABLE_CONTACT_LIST, TpMutableContactListInterface)) +#define TP_MUTABLE_CONTACT_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_MUTABLE_CONTACT_LIST, \ + TpMutableContactList)) + typedef struct _TpMutableContactListInterface TpMutableContactListInterface; +typedef struct _TpMutableContactList TpMutableContactList; -typedef void (*TpBaseContactListRequestSubscriptionFunc) ( - TpBaseContactList *self, +typedef void (*TpMutableContactListRequestSubscriptionFunc) ( + TpMutableContactList *self, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); -typedef void (*TpBaseContactListActOnContactsFunc) ( - TpBaseContactList *self, +typedef void (*TpMutableContactListActOnContactsFunc) ( + TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); +typedef gboolean (*TpMutableContactListAsyncFinishFunc) ( + TpMutableContactList *self, + GAsyncResult *result, + GError **error); + +typedef gboolean (*TpMutableContactListBooleanFunc) ( + TpMutableContactList *self); + +gboolean tp_mutable_contact_list_true_func (TpMutableContactList *self); +gboolean tp_mutable_contact_list_false_func (TpMutableContactList *self); + struct _TpMutableContactListInterface { GTypeInterface parent; /* _async mandatory-to-implement, _finish has a default implementation * suitable for a GSimpleAsyncResult */ - TpBaseContactListRequestSubscriptionFunc request_subscription_async; - TpBaseContactListAsyncFinishFunc request_subscription_finish; + TpMutableContactListRequestSubscriptionFunc request_subscription_async; + TpMutableContactListAsyncFinishFunc request_subscription_finish; - TpBaseContactListActOnContactsFunc authorize_publication_async; - TpBaseContactListAsyncFinishFunc authorize_publication_finish; + TpMutableContactListActOnContactsFunc authorize_publication_async; + TpMutableContactListAsyncFinishFunc authorize_publication_finish; - TpBaseContactListActOnContactsFunc remove_contacts_async; - TpBaseContactListAsyncFinishFunc remove_contacts_finish; + TpMutableContactListActOnContactsFunc remove_contacts_async; + TpMutableContactListAsyncFinishFunc remove_contacts_finish; - TpBaseContactListActOnContactsFunc unsubscribe_async; - TpBaseContactListAsyncFinishFunc unsubscribe_finish; + TpMutableContactListActOnContactsFunc unsubscribe_async; + TpMutableContactListAsyncFinishFunc unsubscribe_finish; - TpBaseContactListActOnContactsFunc unpublish_async; - TpBaseContactListAsyncFinishFunc unpublish_finish; + TpMutableContactListActOnContactsFunc unpublish_async; + TpMutableContactListAsyncFinishFunc unpublish_finish; /* optional-to-implement */ - TpBaseContactListActOnContactsFunc store_contacts_async; - TpBaseContactListAsyncFinishFunc store_contacts_finish; + TpMutableContactListActOnContactsFunc store_contacts_async; + TpMutableContactListAsyncFinishFunc store_contacts_finish; - TpBaseContactListBooleanFunc can_change_contact_list; - TpBaseContactListBooleanFunc get_request_uses_message; + TpMutableContactListBooleanFunc can_change_contact_list; + TpMutableContactListBooleanFunc get_request_uses_message; }; GType tp_mutable_contact_list_get_type (void) G_GNUC_CONST; @@ -219,60 +235,64 @@ gboolean tp_base_contact_list_can_change_contact_list ( gboolean tp_base_contact_list_get_request_uses_message ( TpBaseContactList *self); -void tp_base_contact_list_request_subscription_async (TpBaseContactList *self, +void tp_mutable_contact_list_request_subscription_async ( + TpMutableContactList *self, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_request_subscription_finish ( - TpBaseContactList *self, +gboolean tp_mutable_contact_list_request_subscription_finish ( + TpMutableContactList *self, GAsyncResult *result, GError **error); -void tp_base_contact_list_authorize_publication_async (TpBaseContactList *self, +void tp_mutable_contact_list_authorize_publication_async ( + TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_authorize_publication_finish ( - TpBaseContactList *self, +gboolean tp_mutable_contact_list_authorize_publication_finish ( + TpMutableContactList *self, GAsyncResult *result, GError **error); -void tp_base_contact_list_store_contacts_async (TpBaseContactList *self, +void tp_mutable_contact_list_store_contacts_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_store_contacts_finish (TpBaseContactList *self, +gboolean tp_mutable_contact_list_store_contacts_finish ( + TpMutableContactList *self, GAsyncResult *result, GError **error); -void tp_base_contact_list_remove_contacts_async (TpBaseContactList *self, +void tp_mutable_contact_list_remove_contacts_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_remove_contacts_finish (TpBaseContactList *self, +gboolean tp_mutable_contact_list_remove_contacts_finish ( + TpMutableContactList *self, GAsyncResult *result, GError **error); -void tp_base_contact_list_unsubscribe_async (TpBaseContactList *self, +void tp_mutable_contact_list_unsubscribe_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_unsubscribe_finish (TpBaseContactList *self, +gboolean tp_mutable_contact_list_unsubscribe_finish (TpMutableContactList *self, GAsyncResult *result, GError **error); -void tp_base_contact_list_unpublish_async (TpBaseContactList *self, +void tp_mutable_contact_list_unpublish_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_unpublish_finish (TpBaseContactList *self, +gboolean tp_mutable_contact_list_unpublish_finish (TpMutableContactList *self, GAsyncResult *result, GError **error); @@ -290,143 +310,183 @@ GType tp_blockable_contact_list_get_type (void) G_GNUC_CONST; (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_BLOCKABLE_CONTACT_LIST, TpBlockableContactListInterface)) +#define TP_BLOCKABLE_CONTACT_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_BLOCKABLE_CONTACT_LIST, \ + TpBlockableContactList)) + typedef struct _TpBlockableContactListInterface TpBlockableContactListInterface; -void tp_base_contact_list_contact_blocking_changed ( - TpBaseContactList *self, +typedef struct _TpBlockableContactList TpBlockableContactList; + +void tp_blockable_contact_list_contact_blocking_changed ( + TpBlockableContactList *self, TpHandleSet *changed); gboolean tp_base_contact_list_can_block (TpBaseContactList *self); _TP_AVAILABLE_IN_1_0 -gboolean tp_base_contact_list_is_blocked (TpBaseContactList *self, +gboolean tp_blockable_contact_list_is_blocked (TpBlockableContactList *self, TpHandle contact); -TpHandleSet *tp_base_contact_list_dup_blocked_contacts ( - TpBaseContactList *self); +TpHandleSet *tp_blockable_contact_list_dup_blocked_contacts ( + TpBlockableContactList *self); -void tp_base_contact_list_block_contacts_async (TpBaseContactList *self, +void tp_blockable_contact_list_block_contacts_async (TpBlockableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_block_contacts_finish (TpBaseContactList *self, +gboolean tp_blockable_contact_list_block_contacts_finish ( + TpBlockableContactList *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 -void tp_base_contact_list_block_contacts_with_abuse_async ( - TpBaseContactList *self, +void tp_blockable_contact_list_block_contacts_with_abuse_async ( + TpBlockableContactList *self, TpHandleSet *contacts, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 -gboolean tp_base_contact_list_block_contacts_with_abuse_finish ( - TpBaseContactList *self, +gboolean tp_blockable_contact_list_block_contacts_with_abuse_finish ( + TpBlockableContactList *self, GAsyncResult *result, GError **error); -void tp_base_contact_list_unblock_contacts_async (TpBaseContactList *self, +void tp_blockable_contact_list_unblock_contacts_async (TpBlockableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_unblock_contacts_finish (TpBaseContactList *self, +gboolean tp_blockable_contact_list_unblock_contacts_finish ( + TpBlockableContactList *self, GAsyncResult *result, GError **error); -typedef void (*TpBaseContactListBlockContactsWithAbuseFunc) ( - TpBaseContactList *self, +typedef void (*TpBlockableContactListBlockContactsWithAbuseFunc) ( + TpBlockableContactList *self, TpHandleSet *contacts, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data); +typedef TpHandleSet *(*TpBlockableContactListDupContactsFunc) ( + TpBlockableContactList *self); + +typedef void (*TpBlockableContactListActOnContactsFunc) ( + TpBlockableContactList *self, + TpHandleSet *contacts, + GAsyncReadyCallback callback, + gpointer user_data); + +typedef gboolean (*TpBlockableContactListAsyncFinishFunc) ( + TpBlockableContactList *self, + GAsyncResult *result, + GError **error); + +typedef gboolean (*TpBlockableContactListBooleanFunc) ( + TpBlockableContactList *self); + +gboolean tp_blockable_contact_list_true_func (TpBlockableContactList *self); +gboolean tp_blockable_contact_list_false_func (TpBlockableContactList *self); + struct _TpBlockableContactListInterface { GTypeInterface parent; /* mandatory to implement */ - gboolean (*is_blocked) (TpBaseContactList *self, + gboolean (*is_blocked) (TpBlockableContactList *self, TpHandle contact); - TpBaseContactListDupContactsFunc dup_blocked_contacts; + TpBlockableContactListDupContactsFunc dup_blocked_contacts; /* unblock_contacts_async is mandatory to implement; either * block_contacts_async or block_contacts_with_abuse_async (but not both!) * must also be implemented. _finish have default implementations * suitable for a GSimpleAsyncResult */ - TpBaseContactListActOnContactsFunc block_contacts_async; - TpBaseContactListAsyncFinishFunc block_contacts_finish; - TpBaseContactListActOnContactsFunc unblock_contacts_async; - TpBaseContactListAsyncFinishFunc unblock_contacts_finish; + TpBlockableContactListActOnContactsFunc block_contacts_async; + TpBlockableContactListAsyncFinishFunc block_contacts_finish; + TpBlockableContactListActOnContactsFunc unblock_contacts_async; + TpBlockableContactListAsyncFinishFunc unblock_contacts_finish; /* optional to implement */ - TpBaseContactListBooleanFunc can_block; + TpBlockableContactListBooleanFunc can_block; /* see above. block_contacts_finish is the corresponding _finish function. */ - TpBaseContactListBlockContactsWithAbuseFunc block_contacts_with_abuse_async; + TpBlockableContactListBlockContactsWithAbuseFunc block_contacts_with_abuse_async; }; /* ---- Called by subclasses for ContactGroups ---- */ -void tp_base_contact_list_groups_created (TpBaseContactList *self, +typedef struct _TpContactGroupList TpContactGroupList; + +void tp_contact_group_list_groups_created (TpContactGroupList *self, const gchar * const *created, gssize n_created); -void tp_base_contact_list_groups_removed (TpBaseContactList *self, +void tp_contact_group_list_groups_removed (TpContactGroupList *self, const gchar * const *removed, gssize n_removed); -void tp_base_contact_list_group_renamed (TpBaseContactList *self, +void tp_contact_group_list_group_renamed (TpContactGroupList *self, const gchar *old_name, const gchar *new_name); -void tp_base_contact_list_groups_changed (TpBaseContactList *self, +void tp_contact_group_list_groups_changed (TpContactGroupList *self, TpHandleSet *contacts, const gchar * const *added, gssize n_added, const gchar * const *removed, gssize n_removed); -void tp_base_contact_list_one_contact_groups_changed (TpBaseContactList *self, +void tp_contact_group_list_one_contact_groups_changed (TpContactGroupList *self, TpHandle contact, const gchar * const *added, gssize n_added, const gchar * const *removed, gssize n_removed); /* ---- Implemented by subclasses for ContactGroups ---- */ -gboolean tp_base_contact_list_has_disjoint_groups (TpBaseContactList *self); +typedef gboolean (*TpContactGroupListBooleanFunc) ( + TpContactGroupList *self); -typedef GStrv (*TpBaseContactListDupGroupsFunc) ( - TpBaseContactList *self); +gboolean tp_contact_group_list_false_func ( + TpContactGroupList *self G_GNUC_UNUSED); -GStrv tp_base_contact_list_dup_groups (TpBaseContactList *self); +gboolean tp_contact_group_list_has_disjoint_groups (TpContactGroupList *self); -typedef GStrv (*TpBaseContactListDupContactGroupsFunc) ( - TpBaseContactList *self, +typedef GStrv (*TpContactGroupListDupGroupsFunc) ( + TpContactGroupList *self); + +GStrv tp_contact_group_list_dup_groups (TpContactGroupList *self); + +typedef GStrv (*TpContactGroupListDupContactGroupsFunc) ( + TpContactGroupList *self, TpHandle contact); -GStrv tp_base_contact_list_dup_contact_groups (TpBaseContactList *self, +GStrv tp_contact_group_list_dup_contact_groups (TpContactGroupList *self, TpHandle contact); -typedef TpHandleSet *(*TpBaseContactListDupGroupMembersFunc) ( - TpBaseContactList *self, +typedef TpHandleSet *(*TpContactGroupListDupGroupMembersFunc) ( + TpContactGroupList *self, const gchar *group); -TpHandleSet *tp_base_contact_list_dup_group_members (TpBaseContactList *self, +TpHandleSet *tp_contact_group_list_dup_group_members (TpContactGroupList *self, const gchar *group); -typedef gchar *(*TpBaseContactListNormalizeFunc) ( - TpBaseContactList *self, +typedef gchar *(*TpContactGroupListNormalizeFunc) ( + TpContactGroupList *self, const gchar *s); -gchar *tp_base_contact_list_normalize_group ( - TpBaseContactList *self, +gchar *tp_contact_group_list_normalize_group ( + TpContactGroupList *self, const gchar *s); #define TP_TYPE_CONTACT_GROUP_LIST \ (tp_contact_group_list_get_type ()) GType tp_contact_group_list_get_type (void) G_GNUC_CONST; +#define TP_CONTACT_GROUP_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CONTACT_GROUP_LIST, \ + TpContactGroupList)) + #define TP_IS_CONTACT_GROUP_LIST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_CONTACT_GROUP_LIST)) @@ -441,107 +501,126 @@ typedef struct _TpContactGroupListInterface struct _TpContactGroupListInterface { GTypeInterface parent; /* mandatory to implement */ - TpBaseContactListDupGroupsFunc dup_groups; - TpBaseContactListDupGroupMembersFunc dup_group_members; - TpBaseContactListDupContactGroupsFunc dup_contact_groups; + TpContactGroupListDupGroupsFunc dup_groups; + TpContactGroupListDupGroupMembersFunc dup_group_members; + TpContactGroupListDupContactGroupsFunc dup_contact_groups; /* optional to implement */ - TpBaseContactListBooleanFunc has_disjoint_groups; - TpBaseContactListNormalizeFunc normalize_group; + TpContactGroupListBooleanFunc has_disjoint_groups; + TpContactGroupListNormalizeFunc normalize_group; }; /* ---- Implemented by subclasses for mutable ContactGroups ---- */ -typedef guint (*TpBaseContactListUIntFunc) ( - TpBaseContactList *self); +typedef struct _TpMutableContactGroupList TpMutableContactGroupList; + +typedef gboolean (*TpMutableContactGroupListAsyncFinishFunc) ( + TpMutableContactGroupList *self, + GAsyncResult *result, + GError **error); + +typedef guint (*TpMutableContactGroupListUIntFunc) ( + TpMutableContactGroupList *self); TpContactMetadataStorageType tp_base_contact_list_get_group_storage ( TpBaseContactList *self); -typedef void (*TpBaseContactListSetContactGroupsFunc) (TpBaseContactList *self, +typedef void (*TpMutableContactGroupListSetContactGroupsFunc) ( + TpMutableContactGroupList *self, TpHandle contact, const gchar * const *normalized_names, gsize n_names, GAsyncReadyCallback callback, gpointer user_data); -void tp_base_contact_list_set_contact_groups_async (TpBaseContactList *self, +void tp_mutable_contact_group_list_set_contact_groups_async ( + TpMutableContactGroupList *self, TpHandle contact, const gchar * const *normalized_names, gsize n_names, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_set_contact_groups_finish ( - TpBaseContactList *self, +gboolean tp_mutable_contact_group_list_set_contact_groups_finish ( + TpMutableContactGroupList *self, GAsyncResult *result, GError **error); -typedef void (*TpBaseContactListGroupContactsFunc) (TpBaseContactList *self, +typedef void (*TpMutableContactGroupListGroupContactsFunc) ( + TpMutableContactGroupList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -void tp_base_contact_list_add_to_group_async (TpBaseContactList *self, +void tp_mutable_contact_group_list_add_to_group_async ( + TpMutableContactGroupList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_add_to_group_finish ( - TpBaseContactList *self, +gboolean tp_mutable_contact_group_list_add_to_group_finish ( + TpMutableContactGroupList *self, GAsyncResult *result, GError **error); -void tp_base_contact_list_remove_from_group_async (TpBaseContactList *self, +void tp_mutable_contact_group_list_remove_from_group_async ( + TpMutableContactGroupList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_remove_from_group_finish ( - TpBaseContactList *self, +gboolean tp_mutable_contact_group_list_remove_from_group_finish ( + TpMutableContactGroupList *self, GAsyncResult *result, GError **error); -void tp_base_contact_list_set_group_members_async (TpBaseContactList *self, - const gchar *normalized_group, +void tp_mutable_contact_group_list_set_group_members_async ( + TpMutableContactGroupList *self, + const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_set_group_members_finish ( - TpBaseContactList *self, +gboolean tp_mutable_contact_group_list_set_group_members_finish ( + TpMutableContactGroupList *self, GAsyncResult *result, GError **error); -typedef void (*TpBaseContactListRemoveGroupFunc) (TpBaseContactList *self, +typedef void (*TpMutableContactGroupListRemoveGroupFunc) ( + TpMutableContactGroupList *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data); -void tp_base_contact_list_remove_group_async (TpBaseContactList *self, +void tp_mutable_contact_group_list_remove_group_async ( + TpMutableContactGroupList *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_remove_group_finish (TpBaseContactList *self, +gboolean tp_mutable_contact_group_list_remove_group_finish ( + TpMutableContactGroupList *self, GAsyncResult *result, GError **error); -typedef void (*TpBaseContactListRenameGroupFunc) (TpBaseContactList *self, +typedef void (*TpMutableContactGroupListRenameGroupFunc) ( + TpMutableContactGroupList *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, gpointer user_data); -void tp_base_contact_list_rename_group_async (TpBaseContactList *self, +void tp_mutable_contact_group_list_rename_group_async ( + TpMutableContactGroupList *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, gpointer user_data); -gboolean tp_base_contact_list_rename_group_finish (TpBaseContactList *self, +gboolean tp_mutable_contact_group_list_rename_group_finish ( + TpMutableContactGroupList *self, GAsyncResult *result, GError **error); @@ -557,6 +636,10 @@ GType tp_mutable_contact_group_list_get_type (void) G_GNUC_CONST; (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, TpMutableContactGroupListInterface)) +#define TP_MUTABLE_CONTACT_GROUP_LIST(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, \ + TpMutableContactGroupList)) + typedef struct _TpMutableContactGroupListInterface TpMutableContactGroupListInterface; @@ -566,26 +649,26 @@ struct _TpMutableContactGroupListInterface { /* _async mandatory-to-implement, _finish has a default implementation * suitable for a GSimpleAsyncResult */ - TpBaseContactListSetContactGroupsFunc set_contact_groups_async; - TpBaseContactListAsyncFinishFunc set_contact_groups_finish; + TpMutableContactGroupListSetContactGroupsFunc set_contact_groups_async; + TpMutableContactGroupListAsyncFinishFunc set_contact_groups_finish; - TpBaseContactListGroupContactsFunc set_group_members_async; - TpBaseContactListAsyncFinishFunc set_group_members_finish; + TpMutableContactGroupListGroupContactsFunc set_group_members_async; + TpMutableContactGroupListAsyncFinishFunc set_group_members_finish; - TpBaseContactListGroupContactsFunc add_to_group_async; - TpBaseContactListAsyncFinishFunc add_to_group_finish; + TpMutableContactGroupListGroupContactsFunc add_to_group_async; + TpMutableContactGroupListAsyncFinishFunc add_to_group_finish; - TpBaseContactListGroupContactsFunc remove_from_group_async; - TpBaseContactListAsyncFinishFunc remove_from_group_finish; + TpMutableContactGroupListGroupContactsFunc remove_from_group_async; + TpMutableContactGroupListAsyncFinishFunc remove_from_group_finish; - TpBaseContactListRemoveGroupFunc remove_group_async; - TpBaseContactListAsyncFinishFunc remove_group_finish; + TpMutableContactGroupListRemoveGroupFunc remove_group_async; + TpMutableContactGroupListAsyncFinishFunc remove_group_finish; /* optional to implement */ - TpBaseContactListRenameGroupFunc rename_group_async; - TpBaseContactListAsyncFinishFunc rename_group_finish; - TpBaseContactListUIntFunc get_group_storage; + TpMutableContactGroupListRenameGroupFunc rename_group_async; + TpMutableContactGroupListAsyncFinishFunc rename_group_finish; + TpMutableContactGroupListUIntFunc get_group_storage; }; _TP_AVAILABLE_IN_1_0 diff --git a/telepathy-glib/base-room-config.c b/telepathy-glib/base-room-config.c index 1973b97b6..8055068e8 100644 --- a/telepathy-glib/base-room-config.c +++ b/telepathy-glib/base-room-config.c @@ -759,6 +759,8 @@ validate_property_type ( static TpDBusPropertiesMixinIfaceInfo *iface_info = NULL; TpDBusPropertiesMixinPropInfo *prop_info; + g_return_val_if_fail (value != NULL, FALSE); + if (G_UNLIKELY (iface_info == NULL)) iface_info = tp_svc_interface_get_dbus_properties_info ( TP_TYPE_SVC_CHANNEL_INTERFACE_ROOM_CONFIG1); diff --git a/telepathy-glib/channel.c b/telepathy-glib/channel.c index a35b4372e..d7df915aa 100644 --- a/telepathy-glib/channel.c +++ b/telepathy-glib/channel.c @@ -880,7 +880,7 @@ tp_channel_closed_cb (TpChannel *self, static void tp_channel_connection_invalidated_cb (TpConnection *conn, guint domain, - guint code, + gint code, gchar *message, TpChannel *self) { diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index 93c1a1171..15a3be6dc 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -525,6 +525,7 @@ tp_connection_get_rcc_cb (TpProxy *proxy, goto finally; } + g_return_if_fail (value != NULL); g_assert (self->priv->capabilities == NULL); if (!G_VALUE_HOLDS (value, TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST)) @@ -1026,7 +1027,11 @@ tp_connection_status_changed_cb (TpConnection *self, } static void -tp_connection_invalidated (TpConnection *self) +tp_connection_invalidated (TpConnection *self, + guint domain, + gint code, + gchar *message, + gpointer user_data) { if (self->priv->introspection_call != NULL) { diff --git a/telepathy-glib/dbus-tube-channel.c b/telepathy-glib/dbus-tube-channel.c index 60dc2c013..2dfbf78b4 100644 --- a/telepathy-glib/dbus-tube-channel.c +++ b/telepathy-glib/dbus-tube-channel.c @@ -166,7 +166,7 @@ static void complete_operation (TpDBusTubeChannel *self) { TpDBusTubeChannelPrivate *priv = self->priv; - GSimpleAsyncResult *result = priv->result; + GSimpleAsyncResult *result; /* This dance is to ensure that we don't accidentally manipulate priv->result * while calling out to user code. For instance, someone might call diff --git a/telepathy-glib/dbus.c b/telepathy-glib/dbus.c index 4bc2c5912..0e3bf2697 100644 --- a/telepathy-glib/dbus.c +++ b/telepathy-glib/dbus.c @@ -527,6 +527,7 @@ tp_dbus_connection_request_name (GDBusConnection *dbus_connection, guint32 result; g_return_val_if_fail (G_IS_DBUS_CONNECTION (dbus_connection), FALSE); + g_return_val_if_fail (well_known_name != NULL, FALSE); g_return_val_if_fail (tp_dbus_check_valid_bus_name (well_known_name, TP_DBUS_NAME_TYPE_WELL_KNOWN, error), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -609,6 +610,7 @@ tp_dbus_connection_release_name (GDBusConnection *dbus_connection, GVariant *tuple; g_return_val_if_fail (G_IS_DBUS_CONNECTION (dbus_connection), FALSE); + g_return_val_if_fail (well_known_name != NULL, FALSE); g_return_val_if_fail (tp_dbus_check_valid_bus_name (well_known_name, TP_DBUS_NAME_TYPE_WELL_KNOWN, error), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -777,6 +779,10 @@ tp_dbus_connection_register_object (GDBusConnection *dbus_connection, { GError *error = NULL; + g_return_if_fail (G_IS_DBUS_CONNECTION (dbus_connection)); + g_return_if_fail (object_path != NULL); + g_return_if_fail (object != NULL); + if (!tp_dbus_connection_try_register_object (dbus_connection, object_path, object, &error)) { @@ -807,6 +813,7 @@ _tp_dbus_connection_gather_gdbus_skeletons (GDBusObject *object, GDBusInterface *iface = list_iter->data; const gchar *iface_name = g_dbus_interface_get_info (iface)->name; + g_assert (iface != NULL); if (!G_IS_DBUS_INTERFACE_SKELETON (iface)) { DEBUG ("- not a GDBusInterfaceSkeleton: %s %p", @@ -908,6 +915,7 @@ tp_dbus_connection_try_register_object (GDBusConnection *dbus_connection, gpointer iface_name_p; g_return_val_if_fail (G_IS_DBUS_CONNECTION (dbus_connection), FALSE); + g_return_val_if_fail (object_path != NULL, FALSE); g_return_val_if_fail (tp_dbus_check_valid_object_path (object_path, error), FALSE); g_return_val_if_fail (G_IS_OBJECT (object), FALSE); diff --git a/telepathy-glib/debug-client.c b/telepathy-glib/debug-client.c index 4eb2811f1..4350db28f 100644 --- a/telepathy-glib/debug-client.c +++ b/telepathy-glib/debug-client.c @@ -268,6 +268,8 @@ got_enabled_cb ( { TpDebugClient *self = TP_DEBUG_CLIENT (proxy); + g_return_if_fail (error != NULL || value != NULL); + if (error != NULL) { tp_proxy_invalidate (proxy, error); diff --git a/telepathy-glib/debug.c b/telepathy-glib/debug.c index f8ffc66da..efc902a18 100644 --- a/telepathy-glib/debug.c +++ b/telepathy-glib/debug.c @@ -146,8 +146,8 @@ static DebugKeyToDomain key_to_domain[] = { /** * tp_debug_set_flags: - * @flags_string: The flags to set, comma-separated. If %NULL or empty, - * no additional flags are set. + * @flags_string: (nullable): The flags to set, comma-separated. If %NULL or + * empty, no additional flags are set. * * Set the debug flags indicated by @flags_string, in addition to any already * set. @@ -345,7 +345,7 @@ tp_debug_divert_messages (const gchar *filename) * @log_domain: the message's log domain * @log_level: the log level of the message * @message: the message to process - * @ignored: not used + * @ignored: (nullable): not used * * A #GLogFunc that prepends the UTC time (currently in ISO 8601 format, * with microsecond resolution) to the message, then calls @@ -375,6 +375,9 @@ tp_debug_timestamped_log_handler (const gchar *log_domain, GTimeVal now; gchar *tmp, *now_str; + g_return_if_fail (log_domain != NULL); + g_return_if_fail (message != NULL); + g_get_current_time (&now); now_str = g_time_val_to_iso8601 (&now); tmp = g_strdup_printf ("%s: %s", now_str, message); diff --git a/telepathy-glib/gnio-util.c b/telepathy-glib/gnio-util.c index d3d5f7347..994428cfe 100644 --- a/telepathy-glib/gnio-util.c +++ b/telepathy-glib/gnio-util.c @@ -82,6 +82,8 @@ tp_g_socket_address_from_variant (TpSocketAddressType type, { GSocketAddress *addr; + g_return_val_if_fail (variant != NULL, NULL); + switch (type) { #ifdef HAVE_GIO_UNIX diff --git a/telepathy-glib/handle-repo.c b/telepathy-glib/handle-repo.c index 955cbe91c..8633453b7 100644 --- a/telepathy-glib/handle-repo.c +++ b/telepathy-glib/handle-repo.c @@ -121,6 +121,8 @@ tp_handles_are_valid_variant (TpHandleRepoIface *self, GArray *arr; gboolean result; + g_return_val_if_fail (TP_IS_HANDLE_REPO_IFACE (self), FALSE); + g_return_val_if_fail (handles != NULL, FALSE); g_return_val_if_fail (g_variant_is_of_type (handles, G_VARIANT_TYPE ("au")), FALSE); @@ -162,7 +164,7 @@ tp_handle_inspect (TpHandleRepoIface *self, * tp_handle_ensure: * @self: A handle repository implementation * @id: A string whose handle is required - * @context: User data to be passed to the normalization callback + * @context: (nullable): User data to be passed to the normalization callback * @error: Used to return an error if 0 is returned * * Return a handle for the given string, creating one if necessary. The string @@ -178,6 +180,9 @@ tp_handle_ensure (TpHandleRepoIface *self, gpointer context, GError **error) { + g_return_val_if_fail (TP_IS_HANDLE_REPO_IFACE (self), 0); + g_return_val_if_fail (id != NULL, 0); + return TP_HANDLE_REPO_IFACE_GET_CLASS (self)->ensure_handle (self, id, context, error); } diff --git a/telepathy-glib/introspection.am b/telepathy-glib/introspection.am index d9b8bf12a..ab0a5bfe3 100644 --- a/telepathy-glib/introspection.am +++ b/telepathy-glib/introspection.am @@ -23,6 +23,7 @@ TelepathyGLib_1_gir_FILES = \ $(srcdir)/account-channel-request.c $(srcdir)/account-channel-request.h \ $(srcdir)/account-manager.c $(srcdir)/account-manager.h \ $(srcdir)/automatic-client-factory.c $(srcdir)/automatic-client-factory.h \ + $(srcdir)/base-contact-list.c $(srcdir)/base-contact-list.h \ $(srcdir)/channel-filter.c $(srcdir)/channel-filter.h \ $(srcdir)/connection.c $(srcdir)/connection.h \ $(srcdir)/connection-contact-list.c $(srcdir)/connection-contact-list.h \ diff --git a/telepathy-glib/util.c b/telepathy-glib/util.c index a3f36d7a0..502e50c2e 100644 --- a/telepathy-glib/util.c +++ b/telepathy-glib/util.c @@ -752,10 +752,10 @@ tp_weak_ref_destroy (TpWeakRef *self) /** * tp_simple_async_report_success_in_idle: - * @source: (allow-none): the source object + * @source: (nullable): the source object * @callback: (scope async): the callback - * @user_data: (closure): user data for @callback - * @source_tag: the source tag for the #GSimpleAsyncResult + * @user_data: (nullable) (closure): user data for @callback + * @source_tag: (nullable): the source tag for the #GSimpleAsyncResult * * Create a new #GSimpleAsyncResult with no operation result, and call * g_simple_async_result_complete_in_idle() on it. diff --git a/telepathy-glib/versions/main-1.0.abi b/telepathy-glib/versions/main-1.0.abi index e552c94d7..899d682d9 100644 --- a/telepathy-glib/versions/main-1.0.abi +++ b/telepathy-glib/versions/main-1.0.abi @@ -243,25 +243,25 @@ tp_base_connection_manager_get_type tp_base_connection_manager_register tp_base_connection_register tp_base_connection_set_self_handle -tp_base_contact_list_add_to_group_async -tp_base_contact_list_add_to_group_finish -tp_base_contact_list_authorize_publication_async -tp_base_contact_list_authorize_publication_finish -tp_base_contact_list_block_contacts_async -tp_base_contact_list_block_contacts_finish -tp_base_contact_list_block_contacts_with_abuse_async -tp_base_contact_list_block_contacts_with_abuse_finish +tp_mutable_contact_group_list_add_to_group_async +tp_mutable_contact_group_list_add_to_group_finish +tp_mutable_contact_list_authorize_publication_async +tp_mutable_contact_list_authorize_publication_finish +tp_blockable_contact_list_block_contacts_async +tp_blockable_contact_list_block_contacts_finish +tp_blockable_contact_list_block_contacts_with_abuse_async +tp_blockable_contact_list_block_contacts_with_abuse_finish tp_base_contact_list_can_block tp_base_contact_list_can_change_contact_list -tp_base_contact_list_contact_blocking_changed +tp_blockable_contact_list_contact_blocking_changed tp_base_contact_list_contacts_changed tp_base_contact_list_download_async tp_base_contact_list_download_finish -tp_base_contact_list_dup_blocked_contacts -tp_base_contact_list_dup_contact_groups +tp_blockable_contact_list_dup_blocked_contacts +tp_contact_group_list_dup_contact_groups tp_base_contact_list_dup_contacts -tp_base_contact_list_dup_group_members -tp_base_contact_list_dup_groups +tp_contact_group_list_dup_group_members +tp_contact_group_list_dup_groups tp_base_contact_list_dup_states tp_base_contact_list_false_func tp_base_contact_list_fill_contact_attributes @@ -272,42 +272,42 @@ tp_base_contact_list_get_group_storage tp_base_contact_list_get_request_uses_message tp_base_contact_list_get_state tp_base_contact_list_get_type -tp_base_contact_list_group_renamed -tp_base_contact_list_groups_changed -tp_base_contact_list_groups_created -tp_base_contact_list_groups_removed -tp_base_contact_list_has_disjoint_groups -tp_base_contact_list_is_blocked -tp_base_contact_list_normalize_group +tp_contact_group_list_group_renamed +tp_contact_group_list_groups_changed +tp_contact_group_list_groups_created +tp_contact_group_list_groups_removed +tp_contact_group_list_has_disjoint_groups +tp_blockable_contact_list_is_blocked +tp_contact_group_list_normalize_group tp_base_contact_list_one_contact_changed -tp_base_contact_list_one_contact_groups_changed +tp_contact_group_list_one_contact_groups_changed tp_base_contact_list_one_contact_removed -tp_base_contact_list_remove_contacts_async -tp_base_contact_list_remove_contacts_finish -tp_base_contact_list_remove_from_group_async -tp_base_contact_list_remove_from_group_finish -tp_base_contact_list_remove_group_async -tp_base_contact_list_remove_group_finish -tp_base_contact_list_rename_group_async -tp_base_contact_list_rename_group_finish -tp_base_contact_list_request_subscription_async -tp_base_contact_list_request_subscription_finish -tp_base_contact_list_set_contact_groups_async -tp_base_contact_list_set_contact_groups_finish -tp_base_contact_list_set_group_members_async -tp_base_contact_list_set_group_members_finish +tp_mutable_contact_list_remove_contacts_async +tp_mutable_contact_list_remove_contacts_finish +tp_mutable_contact_group_list_remove_from_group_async +tp_mutable_contact_group_list_remove_from_group_finish +tp_mutable_contact_group_list_remove_group_async +tp_mutable_contact_group_list_remove_group_finish +tp_mutable_contact_group_list_rename_group_async +tp_mutable_contact_group_list_rename_group_finish +tp_mutable_contact_list_request_subscription_async +tp_mutable_contact_list_request_subscription_finish +tp_mutable_contact_group_list_set_contact_groups_async +tp_mutable_contact_group_list_set_contact_groups_finish +tp_mutable_contact_group_list_set_group_members_async +tp_mutable_contact_group_list_set_group_members_finish tp_base_contact_list_set_list_failed tp_base_contact_list_set_list_pending tp_base_contact_list_set_list_received -tp_base_contact_list_store_contacts_async -tp_base_contact_list_store_contacts_finish +tp_mutable_contact_list_store_contacts_async +tp_mutable_contact_list_store_contacts_finish tp_base_contact_list_true_func -tp_base_contact_list_unblock_contacts_async -tp_base_contact_list_unblock_contacts_finish -tp_base_contact_list_unpublish_async -tp_base_contact_list_unpublish_finish -tp_base_contact_list_unsubscribe_async -tp_base_contact_list_unsubscribe_finish +tp_blockable_contact_list_unblock_contacts_async +tp_blockable_contact_list_unblock_contacts_finish +tp_mutable_contact_list_unpublish_async +tp_mutable_contact_list_unpublish_finish +tp_mutable_contact_list_unsubscribe_async +tp_mutable_contact_list_unsubscribe_finish tp_base_media_call_channel_get_local_hold_state tp_base_media_call_channel_get_type tp_base_media_call_content_get_local_media_description @@ -345,7 +345,9 @@ tp_base_room_config_register_class tp_base_room_config_set_can_update_configuration tp_base_room_config_set_property_mutable tp_base_room_config_set_retrieved +tp_blockable_contact_list_false_func tp_blockable_contact_list_get_type +tp_blockable_contact_list_true_func tp_call_channel_accept_async tp_call_channel_accept_finish tp_call_channel_add_content_async diff --git a/telepathy-logger/debug.c b/telepathy-logger/debug.c index 10f9bb4c2..3639f301d 100644 --- a/telepathy-logger/debug.c +++ b/telepathy-logger/debug.c @@ -41,6 +41,18 @@ static GDebugKey keys[] = { { 0, }, }; +/** + * tpl_debug_set_flags: + * @flags_string: (nullable): The flags to set, comma-separated. + * If %NULL or empty, no additional flags are set. + * + * Set the debug flags indicated by flags_string, in addition to any + * already set. + * + * The parsing matches that of g_parse_debug_string(). + * + * Since: UNRELEASED + */ void tpl_debug_set_flags (const gchar *flags_string) { diff --git a/telepathy-logger/log-store-pidgin.c b/telepathy-logger/log-store-pidgin.c index 2aff34fe4..22e82a201 100644 --- a/telepathy-logger/log-store-pidgin.c +++ b/telepathy-logger/log-store-pidgin.c @@ -500,16 +500,15 @@ log_store_pidgin_dup_account (TplLogStorePidgin *self, { TpAccount *acc = (TpAccount *) l->data; GVariant *params; - const gchar *account_param, *server_param; + const gchar *account_param = NULL, *server_param = NULL; if (tp_strdiff (tp_account_get_protocol_name (acc), protocol)) continue; params = tp_account_dup_parameters (acc); - g_variant_lookup (params, - "account", "&s", &account_param, - "server", "&s", &server_param); + g_variant_lookup (params, "account", "&s", &account_param); + g_variant_lookup (params, "server", "&s", &server_param); if (!tp_strdiff (username, account_param)) { diff --git a/telepathy-logger/log-store-sqlite.c b/telepathy-logger/log-store-sqlite.c index 53c1a760d..44cf6b2d8 100644 --- a/telepathy-logger/log-store-sqlite.c +++ b/telepathy-logger/log-store-sqlite.c @@ -534,8 +534,8 @@ out: sqlite3_finalize (sql); /* check that we set an error if appropriate */ - g_assert ((retval == TRUE && *error == NULL) || - (retval == FALSE && *error != NULL)); + g_assert ((retval == TRUE && (error == NULL || *error == NULL)) || + (retval == FALSE && (error == NULL || *error != NULL))); return retval; } @@ -579,8 +579,8 @@ tpl_log_store_sqlite_add_event (TplLogStore *self, out: /* check that we set an error if appropriate */ - g_assert ((retval == TRUE && *error == NULL) || - (retval == FALSE && *error != NULL)); + g_assert ((retval == TRUE && (error == NULL || *error == NULL)) || + (retval == FALSE && (error == NULL || *error != NULL))); DEBUG ("returning with %d", retval); return retval; @@ -746,7 +746,8 @@ out: /* check that we set an error if appropriate * NOTE: retval == NULL && *error != * NULL doesn't apply to this method, since NULL is also for an empty list */ - g_assert ((retval != NULL && *error == NULL) || retval == NULL); + g_assert ((retval != NULL && (error == NULL || *error == NULL)) || + retval == NULL); return retval; } @@ -903,8 +904,8 @@ out: sqlite3_finalize (sql); /* check that we set an error if appropriate */ - g_assert ((retval == TRUE && *error == NULL) || - (retval == FALSE && *error != NULL)); + g_assert ((retval == TRUE && (error == NULL || *error == NULL)) || + (retval == FALSE && (error == NULL || *error != NULL))); return retval; } diff --git a/telepathy-logger/log-store-xml.c b/telepathy-logger/log-store-xml.c index 22acfe808..8021fb9bf 100644 --- a/telepathy-logger/log-store-xml.c +++ b/telepathy-logger/log-store-xml.c @@ -451,7 +451,8 @@ add_text_event (TplLogStoreXml *self, bus_connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error); if (bus_connection == NULL) { - DEBUG ("Error acquiring bus connection: %s", (*error)->message); + DEBUG ("Error acquiring bus connection: %s", + error != NULL ? (*error)->message : "(no GError available)"); goto out; } diff --git a/tests/all-errors-documented.py b/tests/all-errors-documented.py index 3fa53fdbf..235b18f22 100755 --- a/tests/all-errors-documented.py +++ b/tests/all-errors-documented.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # Check if all the errors have been added to # docs/reference/telepathy-glib/telepathy-glib-sections.txt diff --git a/tests/dbus/account.c b/tests/dbus/account.c index 036d485d2..34922de55 100644 --- a/tests/dbus/account.c +++ b/tests/dbus/account.c @@ -154,9 +154,9 @@ test_get_times_notified (Test *test, } static void -test_notify_cb (Test *test, +test_notify_cb (TpAccount *account, GParamSpec *pspec, - TpAccount *account) + Test *test) { guint counter = test_get_times_notified (test, pspec->name); @@ -176,7 +176,7 @@ test_set_up_account_notify (Test *test) g_signal_handler_disconnect (test->account, test->notify_id); } - test->notify_id = g_signal_connect_swapped (test->account, "notify", + test->notify_id = g_signal_connect (test->account, "notify", G_CALLBACK (test_notify_cb), test); } diff --git a/tests/dbus/cli-group.c b/tests/dbus/cli-group.c index 609e75638..f2dcc1b8d 100644 --- a/tests/dbus/cli-group.c +++ b/tests/dbus/cli-group.c @@ -210,13 +210,26 @@ check_invalidated_unknown_error_cb (TpProxy *proxy, } static void +quit_cb (TpChannel *chan_, + GPtrArray *added, + GPtrArray *removed, + GPtrArray *local_pending, + GPtrArray *remote_pending, + TpContact *actor, + GVariant *details, + GMainLoop *loop) +{ + g_main_loop_quit (loop); +} + +static void run_until_members_changed (TpChannel *channel) { GMainLoop *loop = g_main_loop_new (NULL, FALSE); gulong id; - id = g_signal_connect_swapped (channel, "group-members-changed", - G_CALLBACK (g_main_loop_quit), loop); + id = g_signal_connect (channel, "group-members-changed", + G_CALLBACK (quit_cb), loop); g_main_loop_run (loop); diff --git a/tests/dbus/connection-error.c b/tests/dbus/connection-error.c index 16fd4ce9c..fb57f7173 100644 --- a/tests/dbus/connection-error.c +++ b/tests/dbus/connection-error.c @@ -152,11 +152,7 @@ test_registered_error (Test *test, g_variant_unref (asv); g_free (str); - g_assert_cmpstr (g_quark_to_string (error->domain), ==, - g_quark_to_string (example_com_error_quark ())); - g_assert_cmpuint (error->code, ==, DOMAIN_SPECIFIC_ERROR); - g_error_free (error); - error = NULL; + g_clear_error (&error); } static void @@ -283,11 +279,7 @@ test_detailed_error (Test *test, g_assert (ok); g_assert_cmpint (bees, ==, 2342); - g_assert_cmpstr (g_quark_to_string (error->domain), ==, - g_quark_to_string (example_com_error_quark ())); - g_assert_cmpuint (error->code, ==, DOMAIN_SPECIFIC_ERROR); - g_error_free (error); - error = NULL; + g_clear_error (&error); } int diff --git a/tests/dbus/dbus-tube.c b/tests/dbus/dbus-tube.c index fd72421a6..a8ff9f9e0 100644 --- a/tests/dbus/dbus-tube.c +++ b/tests/dbus/dbus-tube.c @@ -265,7 +265,7 @@ handle_double_call (GDBusConnection *connection, { if (!tp_strdiff (method_name, "Double")) { - guint value; + gint value; g_variant_get (parameters, "(i)", &value); diff --git a/tests/lib/contact-list-manager.c b/tests/lib/contact-list-manager.c index d51bf4256..941221364 100644 --- a/tests/lib/contact-list-manager.c +++ b/tests/lib/contact-list-manager.c @@ -189,7 +189,7 @@ contact_list_dup_states (TpBaseContactList *base, } static GStrv -contact_list_dup_groups (TpBaseContactList *base) +contact_list_dup_groups (TpContactGroupList *base) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (base); GPtrArray *ret; @@ -218,10 +218,10 @@ contact_list_dup_groups (TpBaseContactList *base) } static GStrv -contact_list_dup_contact_groups (TpBaseContactList *base, +contact_list_dup_contact_groups (TpContactGroupList *group_list, TpHandle contact) { - TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (base); + TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (group_list); ContactDetails *d = lookup_contact (self, contact); GPtrArray *ret; @@ -249,7 +249,7 @@ contact_list_dup_contact_groups (TpBaseContactList *base, } static TpHandleSet * -contact_list_dup_group_members (TpBaseContactList *base, +contact_list_dup_group_members (TpContactGroupList *base, const gchar *group) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (base); @@ -297,7 +297,7 @@ group_difference (GHashTable *left, } static void -contact_list_set_contact_groups_async (TpBaseContactList *base, +contact_list_set_contact_groups_async (TpMutableContactGroupList *base, TpHandle contact, const gchar * const *names, gsize n, @@ -330,7 +330,7 @@ contact_list_set_contact_groups_async (TpBaseContactList *base, if (new_groups->len > 0) { - tp_base_contact_list_groups_created ((TpBaseContactList *) self, + tp_contact_group_list_groups_created ((TpContactGroupList *) self, (const gchar * const *) new_groups->pdata, new_groups->len); } @@ -348,7 +348,8 @@ contact_list_set_contact_groups_async (TpBaseContactList *base, /* signal the change */ if (added->len > 0 || removed->len > 0) { - tp_base_contact_list_one_contact_groups_changed (base, contact, + tp_contact_group_list_one_contact_groups_changed ( + TP_CONTACT_GROUP_LIST (base), contact, (const gchar * const *) added->pdata, added->len, (const gchar * const *) removed->pdata, removed->len); } @@ -362,7 +363,7 @@ contact_list_set_contact_groups_async (TpBaseContactList *base, } static void -contact_list_set_group_members_async (TpBaseContactList *base, +contact_list_set_group_members_async (TpMutableContactGroupList *base, const gchar *normalized_group, TpHandleSet *contacts, GAsyncReadyCallback callback, @@ -377,7 +378,7 @@ contact_list_set_group_members_async (TpBaseContactList *base, } static void -contact_list_add_to_group_async (TpBaseContactList *base, +contact_list_add_to_group_async (TpMutableContactGroupList *base, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, @@ -392,7 +393,7 @@ contact_list_add_to_group_async (TpBaseContactList *base, } static void -contact_list_remove_from_group_async (TpBaseContactList *base, +contact_list_remove_from_group_async (TpMutableContactGroupList *base, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, @@ -407,7 +408,7 @@ contact_list_remove_from_group_async (TpBaseContactList *base, } static void -contact_list_remove_group_async (TpBaseContactList *base, +contact_list_remove_group_async (TpMutableContactGroupList *base, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) @@ -421,7 +422,7 @@ contact_list_remove_group_async (TpBaseContactList *base, } static void -contact_list_request_subscription_async (TpBaseContactList *self, +contact_list_request_subscription_async (TpMutableContactList *self, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, @@ -445,7 +446,7 @@ contact_list_request_subscription_async (TpBaseContactList *self, } static void -contact_list_authorize_publication_async (TpBaseContactList *self, +contact_list_authorize_publication_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -466,7 +467,7 @@ contact_list_authorize_publication_async (TpBaseContactList *self, } static void -contact_list_remove_contacts_async (TpBaseContactList *self, +contact_list_remove_contacts_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -487,7 +488,7 @@ contact_list_remove_contacts_async (TpBaseContactList *self, } static void -contact_list_unsubscribe_async (TpBaseContactList *self, +contact_list_unsubscribe_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -507,7 +508,7 @@ contact_list_unsubscribe_async (TpBaseContactList *self, } static void -contact_list_unpublish_async (TpBaseContactList *self, +contact_list_unpublish_async (TpMutableContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) @@ -628,12 +629,12 @@ tp_tests_contact_list_manager_add_to_group (TpTestsContactListManager *self, { g_hash_table_insert (self->priv->groups, g_strdup (group_name), GUINT_TO_POINTER (1)); - tp_base_contact_list_groups_created ((TpBaseContactList *) self, + tp_contact_group_list_groups_created ((TpContactGroupList *) self, &group_name, 1); } - tp_base_contact_list_one_contact_groups_changed (base, member, - &group_name, 1, NULL, 0); + tp_contact_group_list_one_contact_groups_changed (TP_CONTACT_GROUP_LIST (base), + member, &group_name, 1, NULL, 0); } void @@ -648,8 +649,8 @@ tp_tests_contact_list_manager_remove_from_group (TpTestsContactListManager *self g_hash_table_remove (d->groups, group_name); - tp_base_contact_list_one_contact_groups_changed (base, member, - NULL, 0, &group_name, 1); + tp_contact_group_list_one_contact_groups_changed (TP_CONTACT_GROUP_LIST (base), + member, NULL, 0, &group_name, 1); } typedef struct { diff --git a/tools/c-constants-gen.py b/tools/c-constants-gen.py index 2b92dc6d9..4880d676b 100644 --- a/tools/c-constants-gen.py +++ b/tools/c-constants-gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 from sys import argv, stdout, stderr import xml.dom.minidom diff --git a/tools/glib-client-gen.py b/tools/glib-client-gen.py index bc117c5d8..b8dd64e69 100644 --- a/tools/glib-client-gen.py +++ b/tools/glib-client-gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # glib-client-gen.py: "I Can't Believe It's Not dbus-binding-tool" # diff --git a/tools/glib-errors-check-gen.py b/tools/glib-errors-check-gen.py index 3cc8a5afb..80bbefebd 100644 --- a/tools/glib-errors-check-gen.py +++ b/tools/glib-errors-check-gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 import sys import xml.dom.minidom diff --git a/tools/glib-errors-str-gen.py b/tools/glib-errors-str-gen.py index ddb1e16b7..67d7fb024 100644 --- a/tools/glib-errors-str-gen.py +++ b/tools/glib-errors-str-gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 import sys import xml.dom.minidom diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py index 184476dda..ebab04063 100644 --- a/tools/glib-ginterface-gen.py +++ b/tools/glib-ginterface-gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # glib-ginterface-gen.py: service-side interface generator # diff --git a/tools/glib-gtypes-generator.py b/tools/glib-gtypes-generator.py index 1477bd37b..05f026c51 100644 --- a/tools/glib-gtypes-generator.py +++ b/tools/glib-gtypes-generator.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # Generate GLib GInterfaces from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - diff --git a/tools/glib-interfaces-gen.py b/tools/glib-interfaces-gen.py index b67d7b4f0..7d68b3546 100644 --- a/tools/glib-interfaces-gen.py +++ b/tools/glib-interfaces-gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 from sys import argv, stdout, stderr import xml.dom.minidom diff --git a/tools/gobject-foo.py b/tools/gobject-foo.py index a2abd7667..34120b60c 100644 --- a/tools/gobject-foo.py +++ b/tools/gobject-foo.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # gobject-foo.py: generate standard GObject type macros etc. # diff --git a/tools/make-version-script.py b/tools/make-version-script.py index 47042d069..8eb15fc07 100644 --- a/tools/make-version-script.py +++ b/tools/make-version-script.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 """Construct a GNU ld or Debian dpkg version-script from a set of RFC822-style symbol lists. diff --git a/tools/manager-file.py b/tools/manager-file.py index d6eda0651..e1ff60e9e 100644 --- a/tools/manager-file.py +++ b/tools/manager-file.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # manager-file.py: generate .manager files and TpCMParamSpec arrays from the # same data (should be suitable for all connection managers that don't have diff --git a/tools/xincludator.py b/tools/xincludator.py index f9ed49ce4..d63389e4b 100644 --- a/tools/xincludator.py +++ b/tools/xincludator.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 import sys from sys import argv, stdout, stderr |