Add Identity.key_mistrusted() sync Release_2.0.5
authorheck <heck@pep.foundation>
Mon, 27 Apr 2020 00:37:48 +0200
branchsync
changeset 37466df0e5b9405
parent 373 436f2d298a38
child 375 29bb9f9c72ca
child 377 8dfd1db025ba
Add Identity.key_mistrusted()
src/identity.cc
src/identity.hh
src/pEpmodule.cc
     1.1 --- a/src/identity.cc	Mon Apr 27 00:32:51 2020 +0200
     1.2 +++ b/src/identity.cc	Mon Apr 27 00:37:48 2020 +0200
     1.3 @@ -14,7 +14,6 @@
     1.4  
     1.5  namespace pEp {
     1.6      namespace PythonAdapter {
     1.7 -        using namespace std;
     1.8  
     1.9          Identity::Identity(string address, string username, string user_id,
    1.10                  string fpr, int comm_type, string lang, identity_flags_t flags)
    1.11 @@ -156,6 +155,12 @@
    1.12              _throw_status(status);
    1.13          }
    1.14  
    1.15 +        void Identity::key_mistrusted()
    1.16 +        {
    1.17 +            PEP_STATUS status = ::key_mistrusted(adapter.session(), *this);
    1.18 +            _throw_status(status);
    1.19 +        }
    1.20 +
    1.21          bool Identity::is_pEp_user()
    1.22          {
    1.23              bool result;
     2.1 --- a/src/identity.hh	Mon Apr 27 00:32:51 2020 +0200
     2.2 +++ b/src/identity.hh	Mon Apr 27 00:37:48 2020 +0200
     2.3 @@ -66,6 +66,7 @@
     2.4              virtual void update();
     2.5  
     2.6              void key_reset(string fpr="");
     2.7 +            void key_mistrusted();
     2.8  
     2.9              bool is_pEp_user();
    2.10  
     3.1 --- a/src/pEpmodule.cc	Mon Apr 27 00:32:51 2020 +0200
     3.2 +++ b/src/pEpmodule.cc	Mon Apr 27 00:37:48 2020 +0200
     3.3 @@ -210,6 +210,16 @@
     3.4              "identity. If it does not, remove the key from the keyring; the key's status is\n"
     3.5              "completely fresh on next contact from the partner.")
     3.6  
     3.7 +        .def("key_mistrusted", &pEp::PythonAdapter::Identity::key_mistrusted,
     3.8 +                boost::python::arg("fpr")=object(""),
     3.9 +            "If you want updated trust on the identity, you ll have"
    3.10 +            "to call update_identity or myself respectively after this."
    3.11 +            "N.B. If you are calling this on a key that is the identity or user default,"
    3.12 +            "it will be removed as the default key for ANY identity and user for which"
    3.13 +            "it is the default. Please keep in mind that the undo in undo_last_mistrust"
    3.14 +            "will only undo the current identity's / it's user's default, not any"
    3.15 +            "other identities which may be impacted (this will not affect most use cases)")
    3.16 +
    3.17          .def("enable_for_sync", &pEp::PythonAdapter::Identity::enable_for_sync,
    3.18                  "Enable own identity for p≡p sync.\n\n"
    3.19                  "Only use this on own identities, which are used as accounts.\n")