From 5225a3950a96ad3e1ba2a4cd3252de20c4e938d4 Mon Sep 17 00:00:00 2001 From: heck Date: Sun, 25 Apr 2021 00:42:46 +0200 Subject: [PATCH] grp interface: group_join() is not part of the MANAGER-API. 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. --- src/adapter_group.cc | 46 ++++++++++++++++++------------------ src/adapter_group.h | 46 ++++++++++++++++++------------------ src/grp_update_drv_dummy.cc | 17 ++++++------- src/grp_update_drv_dummy.hh | 8 +++---- src/grp_update_drv_engine.cc | 16 ++++++------- src/grp_update_drv_engine.hh | 8 +++---- src/grp_update_interface.hh | 11 +++++---- 7 files changed, 78 insertions(+), 74 deletions(-) diff --git a/src/adapter_group.cc b/src/adapter_group.cc index d34c113..ee21908 100644 --- a/src/adapter_group.cc +++ b/src/adapter_group.cc @@ -65,29 +65,29 @@ DYNAMIC_API PEP_STATUS adapter_group_create( return status; } -DYNAMIC_API PEP_STATUS -adapter_group_join(PEP_SESSION session, pEp_identity *group_identity, pEp_identity *as_member) -{ - pEpLog("called"); - // Do listmanager - PEP_STATUS status = gu_listman->adapter_group_join(session, group_identity, as_member); - if (status != PEP_STATUS_OK) { - return status; - } - - // Do engine - status = gu_engine->adapter_group_join(session, group_identity, as_member); - if (status != PEP_STATUS_OK) { - // Rollback listman - //TODO: ???? - // PEP_STATUS rb_stat = gu_listman->adapter_group_dissolve(session, group_identity, manager); - // if (rb_stat != PEP_STATUS_OK) { - // //FATAL ERROR ON ROLLBACK - // status = (PEP_STATUS)-9999; - // } - } - return status; -} +//DYNAMIC_API PEP_STATUS +//adapter_group_join(PEP_SESSION session, pEp_identity *group_identity, pEp_identity *as_member) +//{ +// pEpLog("called"); +// // Do listmanager +// PEP_STATUS status = gu_listman->adapter_group_join(session, group_identity, as_member); +// if (status != PEP_STATUS_OK) { +// return status; +// } +// +// // Do engine +// status = gu_engine->adapter_group_join(session, group_identity, as_member); +// if (status != PEP_STATUS_OK) { +// // Rollback listman +// //TODO: ???? +// // PEP_STATUS rb_stat = gu_listman->adapter_group_dissolve(session, group_identity, manager); +// // if (rb_stat != PEP_STATUS_OK) { +// // //FATAL ERROR ON ROLLBACK +// // status = (PEP_STATUS)-9999; +// // } +// } +// return status; +//} DYNAMIC_API PEP_STATUS adapter_group_dissolve(PEP_SESSION session, pEp_identity *group_identity, pEp_identity *manager) diff --git a/src/adapter_group.h b/src/adapter_group.h index 1d8f6c4..78c701b 100644 --- a/src/adapter_group.h +++ b/src/adapter_group.h @@ -58,29 +58,29 @@ DYNAMIC_API PEP_STATUS adapter_group_create( identity_list *memberlist); -/** - * - * - * @brief Join a group for which we have received an invitation, marking - * our own membership in the database for the group and sending the manager - * a confirmation of the acceptance of the invitation - * - * @param[in] session associated session object - * @param[in] group_identity the pEp_identity object representing the group. Must contain at least - * a user_id and address - * @param[in] as_member the pEp_identity object representing the own identity we want to use to - * join the group. This must match the identity which was invited to the group. - * Must contain a user_id and address. - * - * @retval PEP_STATUS_OK on success - * error on failure - * - * @ownership FIXME - * - * - */ -DYNAMIC_API PEP_STATUS -adapter_group_join(PEP_SESSION session, pEp_identity *group_identity, pEp_identity *as_member); +///** +// * +// * +// * @brief Join a group for which we have received an invitation, marking +// * our own membership in the database for the group and sending the manager +// * a confirmation of the acceptance of the invitation +// * +// * @param[in] session associated session object +// * @param[in] group_identity the pEp_identity object representing the group. Must contain at least +// * a user_id and address +// * @param[in] as_member the pEp_identity object representing the own identity we want to use to +// * join the group. This must match the identity which was invited to the group. +// * Must contain a user_id and address. +// * +// * @retval PEP_STATUS_OK on success +// * error on failure +// * +// * @ownership FIXME +// * +// * +// */ +//DYNAMIC_API PEP_STATUS +//adapter_group_join(PEP_SESSION session, pEp_identity *group_identity, pEp_identity *as_member); /** * diff --git a/src/grp_update_drv_dummy.cc b/src/grp_update_drv_dummy.cc index 0ed32bb..00aff03 100644 --- a/src/grp_update_drv_dummy.cc +++ b/src/grp_update_drv_dummy.cc @@ -29,14 +29,15 @@ namespace pEp { return PEP_STATUS_OK; } - PEP_STATUS GroupUpdateDriverDummy::adapter_group_join( - PEP_SESSION session, - pEp_identity *group_identity, - pEp_identity *as_member) noexcept - { - pEpLogClass("called"); - return PEP_STATUS_OK; - } + // PEP_STATUS GroupUpdateDriverDummy::adapter_group_join( + // PEP_SESSION session, + // pEp_identity *group_identity, + // pEp_identity *as_member) noexcept + // { + // pEpLogClass("called"); + // + // return PEP_STATUS_OK; + // } PEP_STATUS GroupUpdateDriverDummy::adapter_group_dissolve( PEP_SESSION session, diff --git a/src/grp_update_drv_dummy.hh b/src/grp_update_drv_dummy.hh index bec94c7..74a4cb2 100644 --- a/src/grp_update_drv_dummy.hh +++ b/src/grp_update_drv_dummy.hh @@ -20,10 +20,10 @@ namespace pEp { pEp_identity *manager, identity_list *memberlist) noexcept override; - PEP_STATUS adapter_group_join( - PEP_SESSION session, - pEp_identity *group_identity, - pEp_identity *as_member) noexcept override; +// PEP_STATUS adapter_group_join( +// PEP_SESSION session, +// pEp_identity *group_identity, +// pEp_identity *as_member) noexcept override; PEP_STATUS adapter_group_dissolve( PEP_SESSION session, diff --git a/src/grp_update_drv_engine.cc b/src/grp_update_drv_engine.cc index 211c6f4..f8314c9 100644 --- a/src/grp_update_drv_engine.cc +++ b/src/grp_update_drv_engine.cc @@ -18,14 +18,14 @@ namespace pEp { return ::group_create(session, group_identity, manager, memberlist, nullptr); } - PEP_STATUS GroupUpdateDriverEngine::adapter_group_join( - PEP_SESSION session, - pEp_identity *group_identity, - pEp_identity *as_member) noexcept - { - pEpLogClass("called"); - return ::group_join(session, group_identity, as_member); - } +// PEP_STATUS GroupUpdateDriverEngine::adapter_group_join( +// PEP_SESSION session, +// pEp_identity *group_identity, +// pEp_identity *as_member) noexcept +// { +// pEpLogClass("called"); +// return ::group_join(session, group_identity, as_member); +// } PEP_STATUS GroupUpdateDriverEngine::adapter_group_dissolve( PEP_SESSION session, diff --git a/src/grp_update_drv_engine.hh b/src/grp_update_drv_engine.hh index 4525850..9bd334f 100644 --- a/src/grp_update_drv_engine.hh +++ b/src/grp_update_drv_engine.hh @@ -17,10 +17,10 @@ namespace pEp { pEp_identity *manager, identity_list *memberlist) noexcept override; - PEP_STATUS adapter_group_join( - PEP_SESSION session, - pEp_identity *group_identity, - pEp_identity *as_member) noexcept override; +// PEP_STATUS adapter_group_join( +// PEP_SESSION session, +// pEp_identity *group_identity, +// pEp_identity *as_member) noexcept override; PEP_STATUS adapter_group_dissolve( PEP_SESSION session, diff --git a/src/grp_update_interface.hh b/src/grp_update_interface.hh index fac3130..fdf26b4 100644 --- a/src/grp_update_interface.hh +++ b/src/grp_update_interface.hh @@ -16,10 +16,13 @@ namespace pEp { pEp_identity *manager, identity_list *memberlist) noexcept = 0; - virtual PEP_STATUS adapter_group_join( - PEP_SESSION session, - pEp_identity *group_identity, - pEp_identity *as_member) 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,