From fb2ce3f06320f5a3afd1be5745ea6e30f1ba10bd Mon Sep 17 00:00:00 2001 From: heck Date: Mon, 26 Apr 2021 04:16:15 +0200 Subject: [PATCH] Create GroupManagerInterface and move GroupQueryInterface and GroupUpdateInterface into same headerfile --- src/grp_manager_interface.hh | 61 ++++++++++++++++++++++++++++++++++++ src/grp_query_interface.hh | 29 ----------------- src/grp_update_interface.hh | 46 --------------------------- 3 files changed, 61 insertions(+), 75 deletions(-) create mode 100644 src/grp_manager_interface.hh delete mode 100644 src/grp_query_interface.hh delete mode 100644 src/grp_update_interface.hh diff --git a/src/grp_manager_interface.hh b/src/grp_manager_interface.hh new file mode 100644 index 0000000..61349cc --- /dev/null +++ b/src/grp_manager_interface.hh @@ -0,0 +1,61 @@ +// This file is under GNU General Public License 3.0 +// see LICENSE.txt + +#ifndef LIBPEPADAPTER_GRP_MANAGER_INTERFACE_HH +#define LIBPEPADAPTER_GRP_MANAGER_INTERFACE_HH + +#include + +namespace pEp { + namespace Adapter { + class GroupUpdateInterface { + public: + virtual PEP_STATUS adapter_group_create( + ::PEP_SESSION session, + ::pEp_identity *group_identity, + ::pEp_identity *manager, + ::identity_list *memberlist) noexcept = 0; + + virtual PEP_STATUS adapter_group_dissolve( + ::PEP_SESSION session, + ::pEp_identity *group_identity, + ::pEp_identity *manager) noexcept = 0; + + virtual PEP_STATUS adapter_group_invite_member( + ::PEP_SESSION session, + ::pEp_identity *group_identity, + ::pEp_identity *group_member) noexcept = 0; + + virtual PEP_STATUS adapter_group_remove_member( + ::PEP_SESSION session, + ::pEp_identity *group_identity, + ::pEp_identity *group_member) noexcept = 0; + + private: + }; + + class GroupQueryInterface { + public: + virtual PEP_STATUS group_query_groups( + ::PEP_SESSION session, + ::identity_list **groups) noexcept = 0; + + virtual PEP_STATUS group_query_manager( + ::PEP_SESSION session, + const ::pEp_identity *const group, + ::pEp_identity **manager) noexcept = 0; + + virtual PEP_STATUS group_query_members( + ::PEP_SESSION session, + const ::pEp_identity *const group, + ::identity_list **members) noexcept = 0; + + private: + }; + + class GroupManagerInterface : public GroupUpdateInterface, public GroupQueryInterface { + }; + } // namespace Adapter +} // namespace pEp + +#endif // LIBPEPADAPTER_GRP_MANAGER_INTERFACE_HH diff --git a/src/grp_query_interface.hh b/src/grp_query_interface.hh deleted file mode 100644 index 0620db0..0000000 --- a/src/grp_query_interface.hh +++ /dev/null @@ -1,29 +0,0 @@ -// This file is under GNU General Public License 3.0 -// see LICENSE.txt - -#ifndef LIBPEPADAPTER_GRP_QUERY_INTERFACE_HH -#define LIBPEPADAPTER_GRP_QUERY_INTERFACE_HH - -#include -#include - -namespace pEp { - class GroupQueryInterface { - public: - virtual PEP_STATUS group_query_groups(PEP_SESSION session, identity_list **groups) noexcept = 0; - - virtual PEP_STATUS group_query_manager( - PEP_SESSION session, - const pEp_identity *const group, - pEp_identity **manager) noexcept = 0; - - virtual PEP_STATUS group_query_members( - PEP_SESSION session, - const pEp_identity *const group, - identity_list **members) noexcept = 0; - - private: - }; -} // namespace pEp - -#endif // LIBPEPADAPTER_GRP_QUERY_INTERFACE_HH diff --git a/src/grp_update_interface.hh b/src/grp_update_interface.hh deleted file mode 100644 index fdf26b4..0000000 --- a/src/grp_update_interface.hh +++ /dev/null @@ -1,46 +0,0 @@ -// This file is under GNU General Public License 3.0 -// see LICENSE.txt - -#ifndef LIBPEPADAPTER_GRP_UPDATE_INTERFACE_HH -#define LIBPEPADAPTER_GRP_UPDATE_INTERFACE_HH - -#include -#include - -namespace pEp { - class GroupUpdateInterface { - public: - virtual PEP_STATUS adapter_group_create( - PEP_SESSION session, - pEp_identity *group_identity, - pEp_identity *manager, - identity_list *memberlist) noexcept = 0; - - // JOIN does not exist in listmanagers - // For LIB-16 - Store groups a user is part of and provide a method to query them - // We need to create a separate DB _if_ we dont store it in the engine -// virtual PEP_STATUS adapter_group_join( -// PEP_SESSION session, -// pEp_identity *group_identity, -// pEp_identity *as_member) noexcept = 0; - - virtual PEP_STATUS adapter_group_dissolve( - PEP_SESSION session, - pEp_identity *group_identity, - pEp_identity *manager) noexcept = 0; - - virtual PEP_STATUS adapter_group_invite_member( - PEP_SESSION session, - pEp_identity *group_identity, - pEp_identity *group_member) noexcept = 0; - - virtual PEP_STATUS adapter_group_remove_member( - PEP_SESSION session, - pEp_identity *group_identity, - pEp_identity *group_member) noexcept = 0; - - private: - }; -} // namespace pEp - -#endif // LIBPEPADAPTER_GRP_UPDATE_INTERFACE_HH