From 99978b815202e4d9c41aac93ea5871668449a4c7 Mon Sep 17 00:00:00 2001 From: heck Date: Mon, 27 Apr 2020 00:37:48 +0200 Subject: [PATCH] Add Identity.key_mistrusted() --- src/identity.cc | 7 ++++++- src/identity.hh | 1 + src/pEpmodule.cc | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/identity.cc b/src/identity.cc index a941a6a..2f23bcb 100644 --- a/src/identity.cc +++ b/src/identity.cc @@ -14,7 +14,6 @@ namespace pEp { namespace PythonAdapter { - using namespace std; Identity::Identity(string address, string username, string user_id, string fpr, int comm_type, string lang, identity_flags_t flags) @@ -156,6 +155,12 @@ namespace pEp { _throw_status(status); } + void Identity::key_mistrusted() + { + PEP_STATUS status = ::key_mistrusted(adapter.session(), *this); + _throw_status(status); + } + bool Identity::is_pEp_user() { bool result; diff --git a/src/identity.hh b/src/identity.hh index cb423bf..12daf45 100644 --- a/src/identity.hh +++ b/src/identity.hh @@ -66,6 +66,7 @@ namespace pEp { virtual void update(); void key_reset(string fpr=""); + void key_mistrusted(); bool is_pEp_user(); diff --git a/src/pEpmodule.cc b/src/pEpmodule.cc index 0628370..63fa846 100644 --- a/src/pEpmodule.cc +++ b/src/pEpmodule.cc @@ -210,6 +210,16 @@ 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("key_mistrusted", &pEp::PythonAdapter::Identity::key_mistrusted, + boost::python::arg("fpr")=object(""), + "If you want updated trust on the identity, you ll have" + "to call update_identity or myself respectively after this." + "N.B. If you are calling this on a key that is the identity or user default," + "it will be removed as the default key for ANY identity and user for which" + "it is the default. Please keep in mind that the undo in undo_last_mistrust" + "will only undo the current identity's / it's user's default, not any" + "other identities which may be impacted (this will not affect most use cases)") + .def("enable_for_sync", &pEp::PythonAdapter::Identity::enable_for_sync, "Enable own identity for p≡p sync.\n\n" "Only use this on own identities, which are used as accounts.\n")