|
@ -9,6 +9,7 @@ |
|
|
#include <pEp/message_api.h> |
|
|
#include <pEp/message_api.h> |
|
|
#include <pEp/echo_api.h> |
|
|
#include <pEp/echo_api.h> |
|
|
#include <pEp/mixnet.h> |
|
|
#include <pEp/mixnet.h> |
|
|
|
|
|
#include <pEp/echo_api.h> |
|
|
#include <pEp/Adapter.hh> |
|
|
#include <pEp/Adapter.hh> |
|
|
|
|
|
|
|
|
// local
|
|
|
// local
|
|
@ -222,21 +223,6 @@ namespace pEp { |
|
|
_throw_status(status); |
|
|
_throw_status(status); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void send_ping(Identity &own_identity, Identity &other_identity) |
|
|
|
|
|
{ |
|
|
|
|
|
const std::string own_userid = (*own_identity).user_id; |
|
|
|
|
|
if (own_userid == "") |
|
|
|
|
|
throw invalid_argument("user_id needed for own identity"); |
|
|
|
|
|
else if (own_userid != PEP_OWN_USERID) |
|
|
|
|
|
throw invalid_argument("suppesedly own identity not own"); |
|
|
|
|
|
|
|
|
|
|
|
::pEp_identity *own_identity_c = own_identity; |
|
|
|
|
|
::pEp_identity *other_identity_c = other_identity; |
|
|
|
|
|
|
|
|
|
|
|
PEP_STATUS status = PEP_STATUS_OK; |
|
|
|
|
|
status = ::send_ping(Adapter::session(), own_identity_c, other_identity_c); |
|
|
|
|
|
_throw_status(status); |
|
|
|
|
|
|
|
|
|
|
|
boost::python::list onion_identities(unsigned trusted_no, unsigned total_no) |
|
|
boost::python::list onion_identities(unsigned trusted_no, unsigned total_no) |
|
|
{ |
|
|
{ |
|
|
::identity_list *identities = NULL; |
|
|
::identity_list *identities = NULL; |
|
@ -253,7 +239,22 @@ namespace pEp { |
|
|
} |
|
|
} |
|
|
free_identity_list(identities); |
|
|
free_identity_list(identities); |
|
|
return result; |
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void send_ping(Identity &own_identity, Identity &other_identity) |
|
|
|
|
|
{ |
|
|
|
|
|
const std::string own_userid = (*own_identity).user_id; |
|
|
|
|
|
if (own_userid == "") |
|
|
|
|
|
throw invalid_argument("user_id needed for own identity"); |
|
|
|
|
|
else if (own_userid != PEP_OWN_USERID) |
|
|
|
|
|
throw invalid_argument("suppesedly own identity not own"); |
|
|
|
|
|
|
|
|
|
|
|
::pEp_identity *own_identity_c = own_identity; |
|
|
|
|
|
::pEp_identity *other_identity_c = other_identity; |
|
|
|
|
|
|
|
|
|
|
|
PEP_STATUS status = PEP_STATUS_OK; |
|
|
|
|
|
status = ::send_ping(Adapter::session(), own_identity_c, other_identity_c); |
|
|
|
|
|
_throw_status(status); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} // namespace PythonAdapter
|
|
|
} // namespace PythonAdapter
|
|
|