From a082bc35a0d024a2967ad12822fb92e09483a1a4 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Sun, 19 Jan 2020 14:22:03 +0100 Subject: [PATCH] enable_identity_for_sync() and disable_identity_for_sync() --- src/identity.cc | 12 ++++++++++++ src/identity.hh | 3 +++ src/pEpmodule.cc | 3 +++ 3 files changed, 18 insertions(+) diff --git a/src/identity.cc b/src/identity.cc index 6b7f6ac..b7ec03c 100644 --- a/src/identity.cc +++ b/src/identity.cc @@ -164,6 +164,18 @@ namespace pEp { return result; } + void Identity::enable_for_sync() + { + PEP_STATUS status = ::enable_identity_for_sync(adapter.session(), *this); + _throw_status(status); + } + + void Identity::disable_for_sync() + { + PEP_STATUS status = ::disable_identity_for_sync(adapter.session(), *this); + _throw_status(status); + } + Myself::Myself(string address, string username, string user_id, string lang) : Identity(address, username, user_id, "", 0, lang) diff --git a/src/identity.hh b/src/identity.hh index ddb0baa..0690831 100644 --- a/src/identity.hh +++ b/src/identity.hh @@ -67,6 +67,9 @@ namespace pEp { void key_reset(string fpr=""); bool is_pEp_user(); + + void enable_for_sync(); + void disable_for_sync(); }; class Myself : public Identity { diff --git a/src/pEpmodule.cc b/src/pEpmodule.cc index db54ec3..5533897 100644 --- a/src/pEpmodule.cc +++ b/src/pEpmodule.cc @@ -202,6 +202,9 @@ BOOST_PYTHON_MODULE(pEp) "identity. If it does not, remove the key from the keyring; the key's status is\n" "completely fresh on next contact from the partner.") + .def("enable_for_sync", &pEp::PythonAdapter::Identity::enable_for_sync) + .def("disable_for_sync", &pEp::PythonAdapter::Identity::disable_for_sync) + .add_property("address", (string(pEp::PythonAdapter::Identity::*)()) &pEp::PythonAdapter::Identity::address, (void(pEp::PythonAdapter::Identity::*)(string)) &pEp::PythonAdapter::Identity::address, "email address or URI")