diff options
author | Gary Kramlich <grim@reaperworld.com> | 2022-12-14 01:27:42 -0600 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2022-12-14 01:27:42 -0600 |
commit | e1bd09751e5552180c789859dce22390b191ae6f (patch) | |
tree | 752388d57e587fb7e18b08e11573aa1a045b2674 /libpurple/purplecontactmanager.h | |
parent | 0a7c8f794a4dfd44d778a05f1b5194ad0226411a (diff) | |
download | pidgin-e1bd09751e5552180c789859dce22390b191ae6f.tar.gz |
Add tracking of PurplePerson's to PurpleContactManager
The manager keeps track of all of this internally but exposes the collection of
people via the GListModel interface and exposes add_person and remove_person as
well.
Testing Done:
Ran the unit tests.
Reviewed at https://reviews.imfreedom.org/r/2055/
Diffstat (limited to 'libpurple/purplecontactmanager.h')
-rw-r--r-- | libpurple/purplecontactmanager.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libpurple/purplecontactmanager.h b/libpurple/purplecontactmanager.h index be4e895f8f..2c6a92168f 100644 --- a/libpurple/purplecontactmanager.h +++ b/libpurple/purplecontactmanager.h @@ -158,6 +158,36 @@ PurpleContact *purple_contact_manager_find_with_id(PurpleContactManager *manager G_DEPRECATED void purple_contact_manager_add_buddy(PurpleContactManager *manager, PurpleBuddy *buddy); +/** + * purple_contact_manager_add_person: + * @manager: The instance. + * @person: The [class@Purple.Person to add]. + * + * Adds all of the contacts contained in @person to @manager. + * + * This function is mostly intended for unit testing and importing. You + * typically you won't need to call this directly as @manager will + * automatically add the [class@Purple.Person] instance when + * [method@Purple.ContactManager.add] is called. + * + * Since: 3.0.0 + */ +void purple_contact_manager_add_person(PurpleContactManager *manager, PurplePerson *person); + +/** + * purple_contact_manager_remove_person: + * @manager: The instance. + * @person: The [class@Purple.Person] to remove. + * @remove_contacts: Whether or not the contacts should be removed from + * @manager. + * + * Removes @person from @manager optionally removing all of the contacts + * contained in @person as well if @remove_contacts is %TRUE. + * + * Since: 3.0.0 + */ +void purple_contact_manager_remove_person(PurpleContactManager *manager, PurplePerson *person, gboolean remove_contacts); + G_END_DECLS #endif /* PURPLE_CONTACT_MANAGER_H */ |